I am using Spring MVC + Spring Security and I am trying to implement pagination.
To do that, I modified the link in my menu that is pointing to the page where I am going to use pagination.
When clicking the “List” link in my menu with the code below, I got an error 400 : The requested resource is not available.
<li>
<a href="<c:url value="/list.htm" ><c:param name="page" value="1" /></c:url>">List
</a>
</li>
When adding the parameter to the link, without using <c:param>, same thing, error 400:
<li><a href="<c:url value="/list.htm?page=1" />">List</a></li>
When simply using this, without passing any parameter, the link is working properly:
<li><a href="<c:url value="/list.htm" />">List</a></li>
Here is the related code in my controller:
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String getEmployees(@RequestParam(value = "page", required = false) int page, ModelMap model) {
model.addAttribute("employees", this.employeeManager.getEmployees(page));
return "list";
}
Try the following request mapping which uses a wildcard.
You could also try without the wildcard but including .htm