The clarification Paul asked for would be helpful, and I'd also suggest
posting the form bean definition from struts-config.xml along with the
action mappings for both displaying the form and handling its submission.
Re-reading your original post, I suspect you have an action in front of
the form that puts an object into request scope then forwards to a JSP,
but that the action the form submits to points directly at the JSP. If
that's the case, your solution would be to point the 'input' attribute
at the first action instead of at the JSP.
Whether that proves to be the problem or not, overloading validation()
to push data into the request is probably not the best solution, since
it will tightly couple your form processing with a single input source.
L.
[EMAIL PROTECTED] wrote:
Well, I'm using Struts 1.3.5 and DynaValidatorForm + validation.xml for validation. We resolved
the issue Friday, by performing some additional steps. Instead of using DynaValidatorForm, we
created our own class which extends DynaValidatorForm. After we call the validate-method, and it
fails, we add a new object to the request of the page. It seems that, after you call
"validate", a new request for the page is being sent, so if you don't add a new object to
it, it "forgets" all those values.
If there are other solutions, please, feel free to share them.
Kind regards
Bjorn De Bakker
-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: zondag 28 januari 2007 0:26
To: user@struts.apache.org
Subject: Re: Loss of request attributes after validation form
[EMAIL PROTECTED] wrote:
Ok, I resolved the previous error, but now a new one pops up.
This is the situation:
We have a database in which we can look up certain persons. When we find a
person, we have the ability to register him in another database, with
additional values.
If you find a user, you have a button to register him in the other database. If you push that button, an object is put in the request in the following action (req.setAttribute("currentUser", currentUser)). The next screen shows a form, with a few values already there, retrieved from the request (<c:out value=${currentUser.firstName} />) and some textfields to supply additional values (e.g. e-mail). Now, when I push register, the validation is triggered and when it fails, you return to this screen. The problem is that the request is cleared, right before that, so c:out shows nothing.
Is there a way to solve this problem? Or a workaround?
What version of Struts are you using? How are you handling validation?
We will need more details about your setup and configuration to diagnose
this. It sounds like you're doing a redirect after validation, otherwise
the request shouldn't get cleared.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This message is for the designated recipient only and may contain privileged,
proprietary, or otherwise private information. If you have received it in
error, please notify the sender immediately and delete the original. Any other
use of the email by you is prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]