File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes problem in setting value of Field in action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in setting value of Field in action" Watch "problem in setting value of Field in action" New topic

problem in setting value of Field in action

subhasish nag
Ranch Hand

Joined: Apr 25, 2008
Posts: 101
Hi Ranchers,
I have a problem in in setting value of Field (A)in action.Here there is a jsp and two consecutive action. The first action (action1) setting one value of the jsp field and forwards it to another action(action2).But when the second action(action2) is loaded the value of that field(A) set to as per jsp value.(setter method of formbean again called). How can I avoid this situation so that the after setting the field value in first action ,the value of field should not be changed again.

Thanks,<br />Subhasish
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

I suppose "Field" value , means a Form field (property) value, If that's correct, then I suggest to keep that form in session scope and remove any setting of that form from second consecutive action, by modifying it action mapping in struts-config.xml.

If that's not clear to you , than please post the JSP, two action class with there action mapping..

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
I agree. Here's the link:
subject: problem in setting value of Field in action
jQuery in Action, 3rd edition