[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    Re: Retain Form Bean
From:       Laurie Harper <laurie () holoweb ! net>
Date:       2006-10-31 1:53:21
Message-ID: ei6aai$4db$1 () sea ! gmane ! org
[Download RAW message or body]

Puneet Lakhina wrote:
> On 10/28/06, Laurie Harper <laurie@holoweb.net> wrote:
>>
>> Puneet Lakhina wrote:
>> > hi,
>> > I have the following scenario. I have a form that takes certain input.
>> This
>> > in effect goes through certain validations. Now what I want to do is in
>> > case
>> > of validation errors a seprarte page is displayed that lists all the
>> > errors,
>> > and asks the user to continue submitting the data ignoring the errors,
>> > or to
>> > go back to the form and change the data.
>> > My question is how do i submit the data from my error page (which is a
>> > different page), in case the user chooses to continue to submit 
>> ignoring
>> > the
>> > errors.
>> >
>> > So the flow is like this
>> >
>> > form submit-> if errors - >error page - >if continue ->submit data and
>> > store
>> > in Database.
>> >
>> > This continue functionality is what im unable to achieve because I dont
>> > know
>> > how to resubmit the same form values from the error page.
>> >
>> > Any clues??
>>
>> I can think of at least two ways to do this:
>>
>> 1) use session scope for your form bean; wheter the user decides to
>> return and re-edit his data, or submit it, the data is still in the
>> session-scoped form
> 
> Thats what I did. Is that a good thing to do??

Yes, provided you are OK with putting data into the session. Some people 
  prefer to avoid that at all costs :-)

> 2) if you want to avoid using the session, you could serialize the
>> submitted data as hidden fields in the error page; then the user submits
>> that page, their inputs will be re-submitted from the hidden fields, and
>> thus available to the next action
> 
> Thought of this..but wouldnt that make  code maintanence a problem. I 
> mean i
> add a field to the old form..n il have to add it here..n so on... what do
> you think??

Well, if I was going to take that approach, I'd probably look for a way 
to automate it so I didn't have to maintain the mapping by hand.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic