minor fixes
This commit is contained in:
parent
b30b2ffc1e
commit
4a1370d1dd
|
@ -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";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</servlet-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file />
|
||||
</welcome-file-list>
|
||||
|
||||
</web-app>
|
Loading…
Reference in New Issue