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.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class FooController {
|
public class FooController {
|
||||||
|
@ -13,9 +15,21 @@ public class FooController {
|
||||||
// API
|
// API
|
||||||
|
|
||||||
@RequestMapping(value = "/foos")
|
@RequestMapping(value = "/foos")
|
||||||
|
@ResponseBody
|
||||||
public String getFoos() {
|
public String getFoos() {
|
||||||
System.out.println("simplePattern method was called");
|
return "Get some Foos";
|
||||||
return "someResult";
|
}
|
||||||
|
|
||||||
|
@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>
|
</servlet-mapping>
|
||||||
|
|
||||||
<welcome-file-list>
|
<welcome-file-list>
|
||||||
<welcome-file>index.html</welcome-file>
|
<welcome-file />
|
||||||
</welcome-file-list>
|
</welcome-file-list>
|
||||||
|
|
||||||
</web-app>
|
</web-app>
|
Loading…
Reference in New Issue