实际上在我的 spring 应用程序中有 User.jsp 并使用这个 Jsp 我显示详细信息。
在我的 UserProfileForm bean 中,我正在写
private List<ProfessionalForm> professionalDetails = new ArrayList<ProfessionalForm>();
而ProfessionalForm 有另一种形式的细节。
在我的控制器类中,我正在写..
@RequestMapping(value = "user", method = RequestMethod.GET)
public String user(Model model) throws Exception {
UserProfileForm form = (UserProfileForm)FormType.USER_PROFILE.getNewInstance();
model.addAttribute("USER_PROFILE", form);
return "profile/user";
}
还有我的 user.jsp 页面代码..
<form:form action="" modelAttribute="USER_PROFILE">
<div class="answer">
<c:forEach items="${USER_PROFILE.professionalDetails}" var="professionalForm">
<jsp:include page="user/professional.jsp">
<jsp:param value="${professionalForm}" name="PROFESSIONAL" />
</jsp:include>
</c:forEach>
</div>
</form:form>
这是我的专业.jsp ..
<form:form action="profile/proffessional" modelAttribute="PROFESSIONAL">
<p>
<label class="control_label">Postion:</label>
<div class="controls">
<form:input class="text_midem" path="positionName" />
</div>
</p>
</form>
但是我的服务器控制台出现了以下异常..
SEVERE: Servlet.service() for servlet [spring] in context with path [/EClass] threw exception [An exception occurred processing JSP page /WEB-INF/pages/profile/user.jsp at line 40
37: <div class="answer">
38: <c:forEach items="${USER_PROFILE.professionalDetails}"
39: var="professionalForm">
40: <jsp:include page="user/professional.jsp">
41: <jsp:param value="${professionalForm}" name="PROFESSIONAL" />
42: </jsp:include>
43: </c:forEach>
Stacktrace:] with root cause
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'PROFESSIONAL' available as request attribute
at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:141)
为什么这条消息是他们在 User.jsp 页面或 Professional.jsp 中需要的任何循环。
请帮我..
编辑:
而不是<jsp:include>
我们使用...
<%@include file="user/professional.jsp"%>
听说还有错误来...
SEVERE: Servlet.service() for servlet [spring] in context with path [/EClass] threw exception [An exception occurred processing JSP page /WEB-INF/pages/profile/user/professional.jsp at line 16
13: <p>
14: <label class="control_label">Postion:</label>
15: <div class="controls">
16: <form:input class="text_midem" path="positionName" />
17: </div>
18: </p>
19: <p>
Stacktrace:] with root cause
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'PROFESSIONAL' available as request attribute