This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IllegalStateException:Neither BindingResult nor plain target object for bean name available

 
VenkataPrasad Regula
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing this issue since yesterday

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

I have set the value for command i.e commandName in jsp, Controller class and xxx-servlet class. All are thge same I am still facing the exception

POJO file



Controller File



bean mapping file



JSP File
 
VenkataPrasad Regula
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what happens in my case.

1. The login page is filled and submitted. The login page has its command class which is a pojo

2. After submission it is forwarded to a new page which has drop down menu. Hence the new page has an other command class by itself, to load the data related to that page. As I
mention the name of the command class in the jsp while loading the jsp it is displaying the error java.lang.IllegalStateException: Neither Binding Result nor plain target object for
bean name available as request attribute
 
VenkataPrasad Regula
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which ever site I visit on Google, I am finding a form being submitted and the data is being displayed on the second form. Here I have a page(page1) which has a command object to itself and on submission, It moves to second page(page2). page 2 has its own form objects as textbox, dropdown etc. Hence it has its own command object.AS I mention the command object in the second page it is throwing the error, java.lang.IllegalStateException: Neither Binding Result nor plain target object for bean name available as request attribute
 
VenkataPrasad Regula
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not done any thing as DI. I have page 1(Login page). Once the page is submitted it is supposed to go to home page as given below in the success view in bold. The seconddpage Home page has a dropdown menu, for which I created a pojo, to store the data related to that page. I mentioned that class, in the command class and command and mentioned the classname commandclassname of the secong jsp page and the controller class related to that class. It is giving the error(Neither BindingResult nor plain target object for bean name available).
 
Tommy Delson
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problems is similar to other post I have provided the solution see below.

http://www.coderanch.com/t/547929/Spring/IllegalStateException-Neither-BindingResult-nor-plain

Refer to Spring document and other resources for how to do correctly.
 
VenkataPrasad Regula
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tommy,
You appear to have given the wrong url. The URL that has been provided is the URL of my question
 
Tommy Delson
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My bad, here you go: http://www.coderanch.com/t/547675/Spring/Neither-BindingResult-nor-plain-target
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic