During this period, I am studying the Spring MVC showcase example (downloadable from STS dasboard), and I have a simple question about Request Mapping examples:
1) On my home.jsp page, I have this link:
<li> <a id="byParameter" class="textLink" href="<c:url value="/mapping/parameter?foo=bar" />">By path, method, and presence of parameter</a> </li>
As you can see from this link, I am making an HTTP GET request with the parameter "foo" containing the value: "bar".
This HTTP request is processed by the following method of the MappingController controller class:
@RequestMapping(value="/mapping/parameter", method=RequestMethod.GET, params="foo") public @ResponseBody String byParameter() { return "Mapped by path + method + presence of query parameter! (MappingController)"; }
This method manages the HTTP request ( GET type only), which has a parameter named "foo"
How can I take the value ("bar") of this parameter and put it in a variable inside the code of my Parameter method?
AndreaNobili Nov 18 '12 at 17:34 2012-11-18 17:34
source share