On 7/10/05, P B <[EMAIL PROTECTED]> wrote:
> In my web application, user can edit items from their
> inventory. When they request to edit an item, I
> retrieve from the database many properties - most of
> them will be editable by the user, but other is for
> display purposes only.
> 
> Is it proper to put this non-form data in the session?
> That way if validation fails, the user can still see
> the display data required to make informed decision.

Why would not you stick *all* data including data that you are
editing, into a form bean with session scope? This way you can use
redirection from "form submit" phase to "render result" phase, and
keep the values. Two-phase request processing allows a user to refresh
result page without resubmitting form data again. Catch: you would
need to initialize session-scoped form explicitly.

> Also, does anyone have an opinion on the fact that if
> you're using session form, it prevents multiple
> instances of the form to be accessed at once?

Right, this is the issue. If you need that functionality, then you
would have to store data somewhere else, and to copy input data from
form fields to the place where you store them after all fields are
populated from request. You can do this in validate() method or in
action class.

You can use the same validate() method or an action class to copy data
from VO or whatever you use to store data, back to action form for use
in the JSP page. You would need to distinguish input and output
phases.

Michael.

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

Reply via email to