JSPページにリストを表示したいとき、このエラーが発生しています
リストを表示するための私のforeachループ:
<c:forEach var="list" items="${consultantsList}" varStatus="iter">
<c:out value="${list.name}"></c:out>
</c:forEach>
私のコントローラー:
@Controller
@RequestMapping("/patient")
public class PatientController {
@Autowired
private PatientService patientService;
@RequestMapping(value="/registerPatient.htm")
public ModelAndView getRegisterPage()
{
ModelAndView modelAndView=new ModelAndView();
modelAndView.setViewName("register");
List<Consultant> list=patientService.getAllConsultant();
modelAndView.addObject("consultantsList",list);
modelAndView.addObject("patient", new Patient());
return modelAndView;
}
foreach ループを完全に削除すると、jsp は例外なく表示されます。
例外:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB-INF/jsp/i1-smhBaseLayout.jsp'.
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.ja va:656)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
根本原因:
org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB-INF/jsp/i1-smhBaseLayout.jsp'.
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:692)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)