jsp - java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'command' available as request attribute in spring mvc -
please i've been searching error whole day, cannot find precise answer.i want controller take me loginmodel.jsp.
this controller.
@requestmapping(value="/loginmodel",method=requestmethod.get) public string requestlogin(){ return "loginmodel"; }
this jsp loginmodel.jsp
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %><!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"><html><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"></head> <body> <form:form method = "post" action = "/helpdesk/login"> <table> <tr> <td><form:label path = "username">username</form:label></td> <td><form:input path = "username" /></td> </tr> <tr> <td><form:label path = "password">password</form:label></td> <td><form:input path = "password" /></td> </tr> <tr> <td><form:label path = "role">role</form:label></td> <td><form:input path = "role" /></td> </tr> <tr> <td colspan = "2"> <input type = "submit" value = "submit"/> </td> </tr> </table> </form:form>
this error getting
org.apache.jasper.jasperexception: exception occurred processing jsp page /web-inf/jsp/loginmodel.jsp @ line 12 9: <form:form method = "post" action = "/helpdesk/login"> 10: <table> 11: <tr> 12: <td><form:label path = "username">username</form:label></td> 13: <td><form:input path = "username" /></td> 14: </tr> 15: <tr> stacktrace: org.apache.jasper.servlet.jspservletwrapper.handlejspexception(jspservletwrapper.java:568) org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:465) org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:395) org.apache.jasper.servlet.jspservlet.service(jspservlet.java:339) javax.servlet.http.httpservlet.service(httpservlet.java:727) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) org.springframework.web.servlet.view.internalresourceview.rendermergedoutputmodel(internalresourceview.java:238) org.springframework.web.servlet.view.abstractview.render(abstractview.java:250) org.springframework.web.servlet.dispatcherservlet.render(dispatcherservlet.java:1060) org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:798) org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:716) org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:647) org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:552) javax.servlet.http.httpservlet.service(httpservlet.java:620) javax.servlet.http.httpservlet.service(httpservlet.java:727) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) root cause java.lang.illegalstateexception: neither bindingresult nor plain target object bean name 'command' available request attribute org.springframework.web.servlet.support.bindstatus.<init>(bindstatus.java:141) org.springframework.web.servlet.tags.form.abstractdataboundformelementtag.getbindstatus(abstractdataboundformelementtag.java:174) org.springframework.web.servlet.tags.form.abstractdataboundformelementtag.getpropertypath(abstractdataboundformelementtag.java:194) org.springframework.web.servlet.tags.form.labeltag.autogeneratefor(labeltag.java:129) org.springframework.web.servlet.tags.form.labeltag.resolvefor(labeltag.java:119) org.springframework.web.servlet.tags.form.labeltag.writetagcontent(labeltag.java:89) org.springframework.web.servlet.tags.form.abstractformtag.dostarttaginternal(abstractformtag.java:102) org.springframework.web.servlet.tags.requestcontextawaretag.dostarttag(requestcontextawaretag.java:79) org.apache.jsp.web_002dinf.jsp.loginmodel_jsp._jspx_meth_form_005flabel_005f0(loginmodel_jsp.java:193) org.apache.jsp.web_002dinf.jsp.loginmodel_jsp._jspx_meth_form_005fform_005f0(loginmodel_jsp.java:127) org.apache.jsp.web_002dinf.jsp.loginmodel_jsp._jspservice(loginmodel_jsp.java:81) org.apache.jasper.runtime.httpjspbase.service(httpjspbase.java:70) javax.servlet.http.httpservlet.service(httpservlet.java:727) org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:432) org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:395) org.apache.jasper.servlet.jspservlet.service(jspservlet.java:339) javax.servlet.http.httpservlet.service(httpservlet.java:727) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) org.springframework.web.servlet.view.internalresourceview.rendermergedoutputmodel(internalresourceview.java:238) org.springframework.web.servlet.view.abstractview.render(abstractview.java:250) org.springframework.web.servlet.dispatcherservlet.render(dispatcherservlet.java:1060) org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:798) org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:716) org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:647) org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:552) javax.servlet.http.httpservlet.service(httpservlet.java:620) javax.servlet.http.httpservlet.service(httpservlet.java:727) org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52)
Comments
Post a Comment