struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Römer <torsten.roe...@luniks.net>
Subject Re: Good Practice for prepopulating forms?
Date Wed, 09 May 2007 15:30:32 GMT
Thanks, this sure does help...

I must be blind sometimes :-(

Torsten

Musachy Barroso wrote:
> This might help:
> 
> http://struts.apache.org/2.0.6/docs/how-do-we-repopulate-controls-when-validation-fails.html
> 
> 
> musachy
> 
> On 5/9/07, Torsten Römer <torsten.roemer@luniks.net> wrote:
>>
>> I would like to hear what is good practice for prepopulating forms.
>>
>> For example, I want to create a Map with options to populate a select
>> with, and this needs to be done before validation but also after failed
>> validation before the form is redisplayed.
>>
>> Right now I am creating the map in the constructor of the action class
>> but I wonder how to handle possible errors here, for example when a
>> required database connection fails.
>>
>> Is there a method similar to execute() that I could overwrite which is
>> called before validation? I tried to overwrite input() which works fine
>> when the form is initially displayed but input() does not seem to be
>> called after validation failed and the form is redisplayed.
>>
>> Or should I just store the map in the session and reuse it for
>> subsequent requests?
>>
>> Or can/should I change the scope of the action to session?
>>
>> Sorry for these beginner's questions but I would like to do it the right
>> way from the start :-)
>>
>> Torsten
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 

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


Mime
View raw message