• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Action Chaining  RSS feed

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have two action class LoadAction and SaveAction. In Load action i load the page(Details are lables) and in save action i save the details. In some case i do validation at Bean and if the business doesnt allow to save i come back to my Saveaction and i want to go to LoadAction. The problem is my form bean is null in the Load action. So i put my form bean in request and in Load action i got the form from request and assigned to this form. I did the usual things as in load and fwd it to the jsp. But in Jsp i could not find any values. Its all null;

Please help me to overcome this problem.

Regards,
Arul.
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does not seem correct for you to have differnet Action Classes, where you have to use the same Form bean. The very purpose of using STRUTS is lost when you have to pass the form bean in the request to another Action class.



Why not have the methods to load the data and also save that data in the same action class. Thereafter call the appropriate methods from your jsp using javascript depending upon the action the user wants. The Struts container will automatically take care of populating the values in your form bean, if you have created the getter and setter methods for your forms variables correctly.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!