Announcement Announcement Module
Collapse
No announcement yet.
Neither BindingResult nor plain target object for bean name 'command' available Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Neither BindingResult nor plain target object for bean name 'command' available

    Hi all,

    My "test-detail-tile.jsp" code looks as follow:
    Code:
    ...
    <body>
    <P align=right style="font-weight: bold">PBV Test Umgebung</P>
    	<!-- Table Service Provision -->
    	<form:form action="test-provision.html" method="post">
    		<table title="Service Provision" border="1">
    			<thead>
    				<b>Service Provision</b>
    			</thead>
    			<tbody>
    				<tr>
    					<td align="right" width="100" style="font-weight: bold">Request</td>
    					<td width="700" align="left"><form:input path="requestStr" size="120"/></td>
    				</tr>
    				<tr>
    					<td colspan="3" align="center">
    					<input type="reset" value="Reset"/>
    					<input type="submit" value="Sumit"/>
    					</td>
    				</tr>
    			</tbody>
    		</table>
    	</form:form>
    </body>
    ...
    The contorller looks as follow:
    Code:
    public class TestProvisionController extends SimpleFormController{
    
    	
    	public PBVTestProvisionController() {
    		setCommandClass(MQDetailForm.class);
    	}
    
    	@Override
    	protected ModelAndView onSubmit(Object command, BindException errors)
    			throws Exception {
    		MQDetailForm mqDetailForm = (MQDetailForm)command;
    		Map<String, Serializable> model = errors.getModel();
    		model.put("response", mqDetailForm);
    		return new ModelAndView(getSuccessView(), model);
    	}
    	
    }
    The MQDetailForm.java is simply a java bean implemented Serivalizable.

    The problem is, if I try to open the jsp page, I got the exception as shown follow. If I take out the code "<form:input path="requestStr" size="120"/>" from the jsp page, it's ok.

    Why?


    Code:
    [ERROR] 12:08:44 [localhost].[/mq-monitoring-web].[tiles] - Servlet.service() for servlet tiles threw exception
    javax.servlet.jsp.JspException: ServletException in '/WEB-INF/jsp/pbv/test-detail-tile.jsp': Neither BindingResult nor plain target object for bean name 'command' available as request attribute
    	at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
    	at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
    	at org.apache.jsp.WEB_002dINF.jsp.index_jsp._jspx_meth_tiles_005finsert_005f2(index_jsp.java:181)
    	at org.apache.jsp.WEB_002dINF.jsp.index_jsp._jspService(index_jsp.java:92)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    	at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:240)
    	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:252)
    	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1173)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:901)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    	at java.lang.Thread.run(Thread.java:595)

  • #2
    IMHO, <form:form method="post" commandName="command"> should be your form declaration, I might be wrong but, type it like that IN CASE the tag-implementations internally make use of the command name.
    I mean, at least give it a try :P

    Comment


    • #3
      Does your command object have the property:

      <form:input path="requestStr" size="120"/>


      with getters and setters?

      Comment


      • #4
        My command object is simply java bean so it has getters and setters.

        But now figure out the problem. It is because the URLMapping has error.

        Comment

        Working...
        X