PDA

View Full Version : form backing object problems


rossouw
Jul 22nd, 2005, 02:57 AM
Hi there,

My form backing object gives a JspTagException and I don't get why.


javax.servlet.jsp.JspTagException: Neither Errors instance nor plain target object for bean name 'formview' available as request attribute
org.springframework.web.servlet.tags.BindTag.doSta rtTagInternal(BindTag.java:118)
org.springframework.web.servlet.tags.RequestContex tAwareTag.doStartTag(RequestContextAwareTag.java:6 8)
org.apache.jsp.WEB_002dINF.jspx.tranReceiver_jspx. _jspService(tranReceiver_jspx.java:376)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:97)
org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:917)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:696)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:623)
org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:384)
org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:353)
javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:300)
net.sf.acegisecurity.intercept.web.FilterSecurityI nterceptor.invoke(FilterSecurityInterceptor.java:8 4)
net.sf.acegisecurity.intercept.web.SecurityEnforce mentFilter.doFilter(SecurityEnforcementFilter.java :182)
net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:311)
net.sf.acegisecurity.providers.anonymous.Anonymous ProcessingFilter.doFilter(AnonymousProcessingFilte r.java:153)
net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:311)
net.sf.acegisecurity.ui.rememberme.RememberMeProce ssingFilter.doFilter(RememberMeProcessingFilter.ja va:114)
net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:311)
net.sf.acegisecurity.wrapper.ContextHolderAwareReq uestFilter.doFilter(ContextHolderAwareRequestFilte r.java:50)
net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:311)
net.sf.acegisecurity.ui.AbstractProcessingFilter.d oFilter(AbstractProcessingFilter.java:374)
net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:311)
net.sf.acegisecurity.context.HttpSessionContextInt egrationFilter.doFilter(HttpSessionContextIntegrat ionFilter.java:225)
net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:311)
net.sf.acegisecurity.util.FilterChainProxy.doFilte r(FilterChainProxy.java:179)
net.sf.acegisecurity.util.FilterToBeanProxy.doFilt er(FilterToBeanProxy.java:125)

I read up on this and I could only get one explanation, my commandName and my spring:bind are different. But this is not the case:

Bean

<bean id="tranReportValidator" class="co.za.easypay.billpayment.validator.TranReportVali dator"/>
<bean id="tranReport" class="co.za.easypay.billpayment.controller.TranReportCon troller">
<property name="sessionForm"><value>true</value></property>
<property name="commandName"><value>formview</value></property>
<property name="commandClass"><value>co.za.easypay.billpayment.formview.FormView</value></property>
<property name="validator"><ref bean="tranReportValidator"/></property>
<property name="formView"><value>tranReport</value></property>
<property name="successView"><value>TranReport.BPS</value></property>
</bean>


spring:bind


<spring:hasBindErrors name="formview">
<font color="red"><u>Please fix all errors!</u></font>
</spring:hasBindErrors>
<spring:bind path="formview.recName">
<td><input:select name="${status.expression}" attributes="${recNameAttributes}" options="${recName}" default="D" />
<font color="red"><c:out value="${status.errorMessage}"/></font>
</td>
</spring:bind>


could it be because I am changing the form view in the controller?


if((request.getParameter("searchBy") != null)&&(request.getParameter("searchBy").equals("2"))){
jspxName = "tranGroup";
return new ModelAndView(jspxName,myModel_);

katentim
Aug 4th, 2005, 06:16 PM
Make sure you are going via the controller and not hitting or forwarding directly to the JSP.