Get Query String Values in Spring MVC Controller
You can use the getParameter() method from the HttpServletRequest interface.
For example;
public void getMeThoseParams(HttpServletRequest request){
String page = request.getParameter("page");
String goToURL = request.getParameter("gotoUrl");
}
In SpringMVC you can specify values from the query string be parsed and passed in as method parameters with the @RequestParam annotation.
public ModelAndView getPage(
@RequestParam(value="page", required=false) String page,
@RequestParam(value="gotoUrl", required = false) String gotoUrl) {
}