aspose file tools*
The moose likes Struts and the fly likes Reset the Action form values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Reset the Action form values" Watch "Reset the Action form values" New topic
Author

Reset the Action form values

Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
Hi

How to reset the action form values. I have set scope="session" in the struts-config.xml.

Initially am navigating to Show.do, that time am getting word.jsp successfully, while submitting that am setting some values in the Eform. After that again am loading the same page but old values are still present. Please tell me how to reset


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Implement the reset method in your form.
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
I tried.. No use.. At what time the struts will call the reset method of a action form.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Before the action is called.
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
suppose if the action is called twice, then the reset will get called 2 times. Every time before the action or only 1 time
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why would the action be called twice on a single request?

In any case, if you look at the standard request processor, you'll see where it's called.
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
Nope. 2 different request hitting the same action. No worries, let me check the standard Request processor.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If it's requests from the same user, then of course that might cause a problem--there's only a single form per session. If they're from different sessions, then there's no issue.
Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
In the request processor I can see the below code.



But in my action form I have 2 overridded methods but not getting invoked
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reset the Action form values
 
Similar Threads
Use of form bean name in Action mapping for ActionForward class
Problem with ActionErrors
html:options collection tag help URGENT
form bean scope
Struts Cancel Button submits the form