• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your problems is similar to other post I have provided the solution see below.

https://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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My bad, here you go: https://coderanch.com/t/547675/Spring/Neither-BindingResult-nor-plain-target
reply
    Bookmark Topic Watch Topic
  • New Topic