Spring Can';t使用<;通过URL传递参数;c:url>;标签
我正在使用SpringMVC+SpringSecurity,我正在尝试实现分页。 为此,我修改了菜单中的链接,该链接指向我将要使用分页的页面 用下面的代码单击我菜单中的“列表”链接时,我得到一个错误400:请求的资源不可用Spring Can';t使用<;通过URL传递参数;c:url>;标签,spring,spring-mvc,spring-security,jstl,Spring,Spring Mvc,Spring Security,Jstl,我正在使用SpringMVC+SpringSecurity,我正在尝试实现分页。 为此,我修改了菜单中的链接,该链接指向我将要使用分页的页面 用下面的代码单击我菜单中的“列表”链接时,我得到一个错误400:请求的资源不可用 <li> <a href="<c:url value="/list.htm" ><c:param name="page" value="1" /></c:url>">List </a> </
<li>
<a href="<c:url value="/list.htm" ><c:param name="page" value="1" /></c:url>">List
</a>
</li>
尝试以下使用通配符的请求映射
@RequestMapping(value = "/list.htm*", method = RequestMethod.GET)
public String getEmployees(@RequestParam(value = "page", required = false) int page, ModelMap model) {
model.addAttribute("employees", this.employeeManager.getEmployees(page));
return "list";
}
您也可以尝试不使用通配符,但包括.htm
@RequestMapping(value = "/list.htm", method = RequestMethod.GET)
public String getEmployees(@RequestParam(value = "page", required = false) int page, ModelMap model) {
model.addAttribute("employees", this.employeeManager.getEmployees(page));
return "list";
}
尝试以下使用通配符的请求映射
@RequestMapping(value = "/list.htm*", method = RequestMethod.GET)
public String getEmployees(@RequestParam(value = "page", required = false) int page, ModelMap model) {
model.addAttribute("employees", this.employeeManager.getEmployees(page));
return "list";
}
您也可以尝试不使用通配符,但包括.htm
@RequestMapping(value = "/list.htm", method = RequestMethod.GET)
public String getEmployees(@RequestParam(value = "page", required = false) int page, ModelMap model) {
model.addAttribute("employees", this.employeeManager.getEmployees(page));
return "list";
}
在Spring控制器中:
@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";
}
@RequestMapping(value = "/list.htm", method = RequestMethod.GET)
public String funcName(@RequestParam(value = "page", required = false) int page){
return String;
}
在Spring控制器中:
@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";
}
@RequestMapping(value = "/list.htm", method = RequestMethod.GET)
public String funcName(@RequestParam(value = "page", required = false) int page){
return String;
}
@Dukable,很高兴我能帮上忙。您可能想要查看更新,您可能不需要通配符,
.htm
部分可能已经完成了。trickIt在仅添加.htm时也可以工作,没有通配符,再次感谢:)@Dukable,很高兴我能帮上忙。您可能想要查看更新,您可能不需要通配符,.htm
部分可能已经完成了。trickIt在仅添加.htm时也可以工作,没有通配符,再次感谢:)