<jsp:forword page="/first.htm">怎么跳转到springmvc的控制层?我这样写老是报500错 10
@RequestMapping("/first.htm")publicStringindex(Modelmodel,HttpServletRequestreq){List...
@RequestMapping("/first.htm")
public String index(Model model,HttpServletRequest req){
List<Category> list = categoryService.findcate(1);
//把值设置到request中
model.addAttribute("list",list);
Iterator it = list.iterator();
int i = 0;
while(it.hasNext()){
i++;
Category category = (Category) it.next();
List<Category> sonlist = categoryService.findcate(category.getCategoryID());
model.addAttribute("list"+i,sonlist);
}
return "/first.jsp";
}
message An exception occurred processing JSP page /index.jsp at line 2
org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 2
1: <%@page contentType="text/html" pageEncoding="UTF-8"%>
2: <jsp:forward page="first.htm"/>
解决了,是我自己犯二,数据库没开… 展开
public String index(Model model,HttpServletRequest req){
List<Category> list = categoryService.findcate(1);
//把值设置到request中
model.addAttribute("list",list);
Iterator it = list.iterator();
int i = 0;
while(it.hasNext()){
i++;
Category category = (Category) it.next();
List<Category> sonlist = categoryService.findcate(category.getCategoryID());
model.addAttribute("list"+i,sonlist);
}
return "/first.jsp";
}
message An exception occurred processing JSP page /index.jsp at line 2
org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 2
1: <%@page contentType="text/html" pageEncoding="UTF-8"%>
2: <jsp:forward page="first.htm"/>
解决了,是我自己犯二,数据库没开… 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询