Announcement Announcement Module
Collapse
No announcement yet.
Bean Binding Error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bean Binding Error

    I'm trying to implement a 2 input JSP form that maps to a bean in a separate package. My project consists of the following files:

    com.adi.beans.User
    com.adi.controllers.LoginController

    /WEB-INF/applicationContext.xml
    /WEB-INF/spring-sevlet.xml
    /WEB-INF/web.xml

    /WebContent/index.jsp

    I'm getting an error:
    java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'user' available as request attribute
    Please let me know the cause for this. This issue is bugging me since the last 2 days. I've zipped and attached the WAR. These are the JArs I've placed in the lib directory:

    commons-logging-1.1.1.jar
    org.springframework.asm-3.1.0.RELEASE.jar
    org.springframework.beans-3.1.0.RELEASE.jar
    org.springframework.context-3.1.0.RELEASE.jar
    org.springframework.core-3.1.0.RELEASE.jar
    org.springframework.expression-3.1.0.RELEASE.jar
    org.springframework.orm-3.1.0.RELEASE.jar
    org.springframework.web-3.1.0.RELEASE.jar
    org.springframework.web.servlet-3.1.0.RELEASE.jar
    Last edited by adityamondal; Jan 21st, 2012, 05:17 AM.

  • #2
    Somebody, please help. I know I'm doing something stupid.

    Comment


    • #3
      I think you're trying to get a model Object (called "user") which has not been previously attached to.
      You have to add it to the model just before of redirecting to the view, and to get it in the method of your controller which handles the post request.

      Take a look to the spring reference guide
      Here's a good example too: http://puretech.paawak.com/2010/09/0...g-mvc-how-tos/

      Comment

      Working...
      X