• Register
0 votes
51 views

Problem :

I am very new to Spring 3's annotation and I am getting the exception.

Below is my form jsp code:

 <form:form method="POST" action="login.htm" modelAttribute="login">

  ....

  <form:input path="email" size="30" />

  ....

And following is the shameful exception I am getting whenever I try to load my landing jsp page:

SEVERE: Neither BindingResult nor plain target object for bean name 'login' available as request attribute

java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'login' available as request attribute

 at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:141)

 at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:174)

at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:194)

 at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getName(AbstractDataBoundFormElementTag.java:160)

at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.autogenerateId(AbstractDataBoundFormElementTag.java:147)

at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.resolveId(AbstractDataBoundFormElementTag.java:138)

at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.writeDefaultAttributes(AbstractDataBoundFormElementTag.java:122)

at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:408)

at org.springframework.web.servlet.tags.form.InputTag.writeTagContent(InputTag.java:140)

at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:102)

at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)

at org.apache.jsp.WEB_002dINF.jsp.landing_jsp._jspx_meth_form_input_0(landing_jsp.java from :208)

at org.apache.jsp.WEB_002dINF.jsp.landing_jsp._jspx_meth_form_form_0(landing_jsp.java from :164)

at org.apache.jsp.WEB_002dINF.jsp.landing_jsp._jspService(landing_jsp.java from :107)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)

    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)

    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)

    at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:787)

    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)

    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:483)

    at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)

    at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)

    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:300)

    at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)

    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)

    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)

    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)

    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)

    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669)

    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:574)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)

    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)

    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)

    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)

    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)

    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)

    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)

    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

    at java.lang.Thread.run(Thread.java:680)

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

To begin with you need to add the login object as an attribute of the model in the controller:

model.addAttribute("login", new Login());

Like following:

@RequestMapping(value = "/", method = RequestMethod.GET)

public String displayLogin(Model model) {

model.addAttribute("login", new Login());

return "login";

}

9 7 4
38,600 points

Related questions

0 votes
2 answers 213 views
213 views
Problem : I have created entities, services and JUnit tests for services using Spring and Hibernate for my project. All of these are working. After that I added spring-mvc to it to make this web application but while trying to make ... follows ..Could not autowire field: public pl.com.radzikowski.webmail.service.IMailManager pl.com.radzikowski.webmail.controller.HomeController.mailManager...
asked Nov 20, 2019 peterlaw 6.9k points
1 vote
1 answer 2.7K views
2.7K views
Problem : When I try to compile my spring project, I always face the below error : Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed I have the ... >1.4.1.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> . . .
asked Dec 12, 2019 alecxe 7.5k points
0 votes
1 answer 48 views
48 views
Problem : For many days I am trying to create Spring CRUD application but getting following error org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean with name
asked Nov 13, 2019 peterlaw 6.9k points
0 votes
1 answer 2.8K views
2.8K views
Problem : I am trying to write Spring boot code The Program is running but I am getting following error: This application has no explicit mapping for /error, so you are seeing this as a fallback. How to fix this error?
asked Nov 22, 2019 peterlaw 6.9k points
0 votes
1 answer 4.9K views
4.9K views
Problem : I am developing the application in Spring, using a Tomcat, Mysql5, Java8... My problem is that I cannot deploy it, due to the "required bean 'entityManagerFactory' not found" problem. I have developed my project with the coworkers but ... a bean named 'entityManagerFactory' that could not be found. Action: Consider defining a bean named 'entityManagerFactory' in your configuration.
asked Jan 25, 2020 jwilliam 3.9k points
1 vote
1 answer 1.7K views
1.7K views
Problem : I am beginner to spring + hibernate. Recently I have created the application with the use of spring + hibernate but I always face below error. I am trying to work on it for the very first time. Below is the error for your ... ) at coreservlets.StudentDAOImpl.create(StudentDAOImpl.java:19) at coreservlets.MainApp.main(MainApp.java:14) Can somebody help me in overcoming above error?
asked Mar 28, 2020 morrisBson 3.2k points
0 votes
1 answer 2.2K views
2.2K views
Problem : I am trying to use the curl command as follows: curl -u 591bf65f50057469f10b5fd9:0cf17f9b03d056ds0e11e48497e506a2 https://backend.tdk.com/api/devicetypes/59147fd79e93s12e61499ffe/messages But I am getting a JSON response as follows: {"data":[{"device":"18SE62"," ... T>, Object...) in the type RestTemplate is not applicable for the arguments (String, HttpEntity<String>,Class<MessageList>)
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 22 views
22 views
Problem: I get this message when i login with Filezilla. &ldquo;Connection attempt failed with "eai_noname - neither nodename nor servname provided, or not known&rdquo; Can any one guide further? My domain name is aaa.bbbb.com and cpanel ftp configuration told me that ftp server is ftp.aaa.bbb.com Looks like something related with dns resolving?
asked Jul 16, 2020 quizzBabes 160 points
0 votes
1 answer 56 views
56 views
Problem : I am beginner to CentOS. I tried executing sudo ./startup.sh in my CentOS, But I am facing the below error: "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined" I have already defined them in my bashrc as shown below: export JAVA_HOME=/home/mphil/New_learning/jdk1.8.0_212 export PATH=$JAVA_HOME/bin:$PATH How to fix this error?
asked Feb 27, 2020 mphil 2.3k points
0 votes
1 answer 2.3K views
2.3K views
Problem : Facing following strange issue input is a void element tag and must neither have `children` nor use `dangerouslysetinnerhtml`.
asked Nov 13, 2019 peterlaw 6.9k points