You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Torsten Römer <to...@luniks.net> on 2007/05/09 10:45:20 UTC

Good Practice for prepopulating forms?

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


Re: Good Practice for prepopulating forms?

Posted by Torsten Römer <to...@luniks.net>.
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 <to...@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


Re: Good Practice for prepopulating forms?

Posted by Musachy Barroso <mu...@gmail.com>.
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 <to...@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
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

RE: Good idea of installing a file on host machine

Posted by Al Sutton <al...@alsutton.com>.
Read up on Web Start, it's not all that new, and a web start application
isn't going to be able to efficiently use struts for it's presentation.

-----Original Message-----
From: Kapil Sharma [mailto:kapil.sharma@iap-online.com] 
Sent: 10 May 2007 04:15
To: Struts Users Mailing List
Subject: RE: Good idea of installing a file on host machine

Thanks,

But i heard of  a new trechnology called web start.

I think i can generate a new jnlp file at runtime. Pass it certain
parameters from my browser, and that installer will also run the exe from my
client PC using something called Persistent Service

I need to study more


Thanks and Regards,
Kapil Sharma


-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of Laurie Harper
Sent: Thursday, May 10, 2007 11:59 AM
To: user@struts.apache.org
Subject: Re: [OT] Good idea of installing a file on host machine


Kapil Sharma wrote:
> Hello,
>
> I know it is not a struts based query but still i would like to have 
> your idea,
>
> Can i install a file on the client host of the pc e.g. a text file
whenever
> a user presses some action in my jsp.
>
> If yes can i run that file if it is exe. I am thinking of some 
> parallel activity on clietn side that should interact with my server

Ugh, no, there's no sane way to do that. The security implications, if it
were possible, would be scary to contemplate.

If you want client-side processing, use Javascript or, if you're more
ambitious maybe an applet or something.

L.


---------------------------------------------------------------------
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



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


RE: Good idea of installing a file on host machine

Posted by "Raghupathy, Gurumoorthy" <Gu...@nielsen.com>.
What does this has to do with struts ? 



-----Original Message-----
From: Kapil Sharma [mailto:kapil.sharma@iap-online.com] 
Sent: 10 May 2007 04:15
To: Struts Users Mailing List
Subject: RE: Good idea of installing a file on host machine

Thanks,

But i heard of  a new trechnology called web start.

I think i can generate a new jnlp file at runtime. Pass it certain
parameters from my browser, and that installer will also run the exe
from my
client PC
using something called Persistent Service

I need to study more


Thanks and Regards,
Kapil Sharma


-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of Laurie Harper
Sent: Thursday, May 10, 2007 11:59 AM
To: user@struts.apache.org
Subject: Re: [OT] Good idea of installing a file on host machine


Kapil Sharma wrote:
> Hello,
>
> I know it is not a struts based query but still i would like to have
your
> idea,
>
> Can i install a file on the client host of the pc e.g. a text file
whenever
> a user presses some action in my jsp.
>
> If yes can i run that file if it is exe. I am thinking of some
parallel
> activity on clietn side that should interact with my server

Ugh, no, there's no sane way to do that. The security implications, if
it were possible, would be scary to contemplate.

If you want client-side processing, use Javascript or, if you're more
ambitious maybe an applet or something.

L.


---------------------------------------------------------------------
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


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


RE: Good idea of installing a file on host machine

Posted by Kapil Sharma <ka...@iap-online.com>.
Thanks,

But i heard of  a new trechnology called web start.

I think i can generate a new jnlp file at runtime. Pass it certain
parameters from my browser, and that installer will also run the exe from my
client PC
using something called Persistent Service

I need to study more


Thanks and Regards,
Kapil Sharma


-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of Laurie Harper
Sent: Thursday, May 10, 2007 11:59 AM
To: user@struts.apache.org
Subject: Re: [OT] Good idea of installing a file on host machine


Kapil Sharma wrote:
> Hello,
>
> I know it is not a struts based query but still i would like to have your
> idea,
>
> Can i install a file on the client host of the pc e.g. a text file
whenever
> a user presses some action in my jsp.
>
> If yes can i run that file if it is exe. I am thinking of some parallel
> activity on clietn side that should interact with my server

Ugh, no, there's no sane way to do that. The security implications, if
it were possible, would be scary to contemplate.

If you want client-side processing, use Javascript or, if you're more
ambitious maybe an applet or something.

L.


---------------------------------------------------------------------
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


Re: [OT] Good idea of installing a file on host machine

Posted by Laurie Harper <la...@holoweb.net>.
Kapil Sharma wrote:
> Hello,
> 
> I know it is not a struts based query but still i would like to have your
> idea,
> 
> Can i install a file on the client host of the pc e.g. a text file whenever
> a user presses some action in my jsp.
> 
> If yes can i run that file if it is exe. I am thinking of some parallel
> activity on clietn side that should interact with my server

Ugh, no, there's no sane way to do that. The security implications, if 
it were possible, would be scary to contemplate.

If you want client-side processing, use Javascript or, if you're more 
ambitious maybe an applet or something.

L.


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


Re: Good idea of installing a file on host machine

Posted by Laurie Harper <la...@holoweb.net>.
Vijay Prajapati wrote:
> can we user HIDEFOCUS attribute in <s:a href=""> tag in Struts2.0.6?

According to the reference documentation for that tag [1] no, there is 
no such attribute.

L.

ObWhine: please don't post unrelated questions to an existing thread. Be 
sure to start a new thread (with an appropriate subject) by sending a 
fresh message to the list, rather than using Reply To.

[1] http://struts.apache.org/2.x/docs/a.html


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


Re: Good idea of installing a file on host machine

Posted by Vijay Prajapati <vi...@gmail.com>.
can we user HIDEFOCUS attribute in <s:a href=""> tag in Struts2.0.6?

Vijay Prajapati

Good idea of installing a file on host machine

Posted by Kapil Sharma <ka...@iap-online.com>.
Hello,

I know it is not a struts based query but still i would like to have your
idea,


Can i install a file on the client host of the pc e.g. a text file whenever
a user presses some action in my jsp.

If yes can i run that file if it is exe. I am thinking of some parallel
activity on clietn side that should interact with my server

Any idea will be greatly appreciated

Thanks and Regards,
Kapil Sharma





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