aspose file tools*
The moose likes Struts and the fly likes Problem with ActionErrors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with ActionErrors" Watch "Problem with ActionErrors" New topic
Author

Problem with ActionErrors

Fred Artes
Ranch Hand

Joined: Nov 14, 2008
Posts: 43
This is my situation :

1) Action_A set a list in actionform (ActionForm_A)
2) go to jsp_A (an insert form)
3) Action_B save data posted in insert form

Action_A and Action_B work on the same form (ActionForm_A)

If before the call of Action B, actionForm throw an ActionError, control return to jsp_A. Two cases :

a) ActionForm_A has scope="request" --> I have an error because I don't have more list upload by Action_A in jsp_A

b) ActionForm_A has scope="session" --> all works but data in the insert form are not reset

Which is the best practise to resolve this problem ?

Sorry for my bad English
Thanks

[ December 12, 2008: Message edited by: Fred Artes ]
[ December 12, 2008: Message edited by: Fred Artes ]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What do you mean by "not reset"? Wouldn't you want to keep the form values if there's a validation error?

In any case: are you redirecting or forwarding to the JSP? If you forward you can use a request-scope form.

f you have specialized form reset needs then implement reset() in the form.
Fred Artes
Ranch Hand

Joined: Nov 14, 2008
Posts: 43
Originally posted by David Newton:
What do you mean by "not reset"? Wouldn't you want to keep the form values if there's a validation error?

In any case: are you redirecting or forwarding to the JSP? If you forward you can use a request-scope form.

f you have specialized form reset needs then implement reset() in the form.


Yes, I want keep form values if there is validation error. This is my struts-config



I have not a specialized form reset
Fred Artes
Ranch Hand

Joined: Nov 14, 2008
Posts: 43
I'm doing a simple findforward to jsp
Help please !!
Fred Artes
Ranch Hand

Joined: Nov 14, 2008
Posts: 43
Nobody knows how I can resolve this problem ?
I'm surpriesed ......
[ December 17, 2008: Message edited by: Fred Artes ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with ActionErrors