Eddie Bush wrote:
Application-specific exceptions are one of the least used and most useful tools. That's exactly how I'd go about doing it, and I dare say it's the right way.


Indeed. One thing I've found with this approcah: if I don't put all the mandatory data in the form, I get an error message (as expected) and my for is reloaded -- with all the previous data removed.


Currently, to circumvent this problem, we have to take that data from the form and store it in the session. It's all done inside the action and involves a fair amount of gymnastics (defining special request parameters, dealing with them in the action, etc).

Is there a simpler way? Is there a way to tell struts to reload the *modified* data tha was entered in the form without jumping through hoops?

For example, say you have a Person form which has 10 fields, of which three (last name, first name and sex) are mandatory. The way we have things set up, if we enter data for all the fields and miss one of the mandatory fields, the form is redisplayed and everything ise removed. What I'd like is for the form to be redisplayed, using the data I entered originally, or the modified data.

It might be important to know that we use the same form to add and to modify data. We have two different actions (/edit* and /add*) that map to the same page. The page will behave differently, depending on whether we are adding or modifying data.

Thanks,

L


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to