• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Help on struts 2 bean usage

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably I am doing something really stupid, but can anyone please explain?
I have a jsp and, at the top, before the html tag I populate a bean as follows:
<s:bean name="lucaluke.MyBean" var="myBean">
<s:param name="model"><s:property value="codePassed" /></s:param> <!-- this is just a code passed from previous action -->
</s:bean>
Let's say in html I print the value from myBean.model, this is also fine.

then on the page I use the value from the bean, I have a form which calls an action and all is fine.
Problem is when the validation in the action fails (validate() method...) in this case I correctly addFieldError and go to the jsp set as input in struts.xml
the error is correctly displayed but...
As in input I have defined to remain on the same jsp as before, I would expect myBean to be still valid, am I correct in this assumption?
should myBean and / or codePassed as defined above still be valid or not? because apparently, they are not and I end up with a more or less blank page...
What am I doing wrong? Something really stupid I guess?
thanks
    Bookmark Topic Watch Topic
  • New Topic