Results 1 to 3 of 3

Thread: Bean Binding Error

  1. #1

    Unhappy 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
    Attached Files Attached Files
    Last edited by adityamondal; Jan 21st, 2012 at 04:17 AM.

  2. #2

    Default

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

  3. #3
    Join Date
    Dec 2011
    Posts
    11

    Default

    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/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •