updating mappings so that the project can be used for other purposes
This commit is contained in:
parent
05cf9b7541
commit
f06b24bea2
|
@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
@RequestMapping(value = "/ex")
|
||||||
public class BarMappingExamplesController {
|
public class BarMappingExamplesController {
|
||||||
|
|
||||||
public BarMappingExamplesController() {
|
public BarMappingExamplesController() {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
|
@RequestMapping(value = "/ex")
|
||||||
public class FooMappingExamplesController {
|
public class FooMappingExamplesController {
|
||||||
|
|
||||||
public FooMappingExamplesController() {
|
public FooMappingExamplesController() {
|
||||||
|
@ -59,10 +60,16 @@ public class FooMappingExamplesController {
|
||||||
return "Get some Foos with Header";
|
return "Get some Foos with Header";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @RequestMapping(value = "/foos", method = RequestMethod.GET, headers = "Accept=application/json")
|
||||||
|
// @ResponseBody
|
||||||
|
// public String getFoosAsJsonFromBrowser() {
|
||||||
|
// return "Get some Foos with Header Old";
|
||||||
|
// }
|
||||||
|
|
||||||
@RequestMapping(value = "/foos", produces = { "application/json", "application/xml" })
|
@RequestMapping(value = "/foos", produces = { "application/json", "application/xml" })
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String getFoosAsJsonFromREST() {
|
public String getFoosAsJsonFromREST() {
|
||||||
return "Get some Foos with Header Exact";
|
return "Get some Foos with Header New";
|
||||||
}
|
}
|
||||||
|
|
||||||
// advanced - multiple mappings
|
// advanced - multiple mappings
|
||||||
|
|
Loading…
Reference in New Issue