minor fixes

This commit is contained in:
Eugen 2013-05-15 18:52:45 +03:00
parent b30b2ffc1e
commit 4a1370d1dd
2 changed files with 17 additions and 3 deletions

View File

@ -2,6 +2,8 @@ package org.baeldung.spring.web.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class FooController {
@ -13,9 +15,21 @@ public class FooController {
// API
@RequestMapping(value = "/foos")
@ResponseBody
public String getFoos() {
System.out.println("simplePattern method was called");
return "someResult";
return "Get some Foos";
}
@RequestMapping(value = "/foos", method = RequestMethod.POST)
@ResponseBody
public String getFoosPost() {
return "Post some Foos";
}
@RequestMapping(value = "/foos", method = RequestMethod.POST, headers = "key=val")
@ResponseBody
public String getFoosWithHeader() {
return "Get some Foos with Header";
}
}

View File

@ -36,7 +36,7 @@
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file />
</welcome-file-list>
</web-app>