You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Long <ja...@supernovasoftware.com> on 2003/03/13 03:38:43 UTC

Dynamic form value replacements???

I have a form that is dynamically created as a jsp in xml syntax.  There are
an arbitrary number of text fields that need to be validated.  Could someone
point me to an example of how to do this?  I have no way of creating the set
and get methods in the form class unless I dynamically create the java code
and recompile.  This is not an option.

Thank you for your time,

Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS  Chemical Engineering

-----Original Message-----
From: louis majanja [mailto:louis@ironpulse.com]
Sent: Wednesday, March 12, 2003 6:27 PM
To: Struts Users Mailing List
Subject: [HELP] ActionMessages <html:messages />


i have this in my actionForm:
ActionMessages messages = new ActionMessages();

   messages.add("message",
                  new ActionMessage("message.login.confirmation"));
  saveMessage(request,messages);

in my jsp i have

<html:messages />

it doesn't work, i have tried the following options which don't work
either

<html:messages message="true"/>

<html:messages id="msg" property="messages" message="true">
  <c:out value="${msg}"/>
</html:messages>

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



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


RE: One-time initializing in struts

Posted by Scott Barr <sc...@exergonic.com.au>.
Hi Karl

I use a Servlet to do app initialisation. 
Add the Servlet to web.xml, and set the load-on-startup parameter. Then
you put the initialisation code in the Servlet, and you're away.

Scott Barr
www.exergonic.com.au


On Thu, 2003-03-13 at 17:05, Andrew Hill wrote:
> Struts PlugIn might be the best option for that. Check the docs. Dont think
> its supported in 1.0 though, just 1.1. (With each 1.1.x version having a
> different interface!)
> 
> -----Original Message-----
> From: Karl [mailto:karl@webartjapan.com]
> Sent: Thursday, 13 March 2003 14:26
> To: Struts Users Mailing List
> Subject: One-time initializing in struts
> 
> 
> Is there a way to do one-time initialization in struts without having to put
> check logicn in every action?
> 
> I want to use turbine as my persistance back-end but I need to call
> Torque.init("Torque.properties"); somewhere.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


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


RE: One-time initializing in struts

Posted by Andrew Hill <an...@gridnode.com>.
Struts PlugIn might be the best option for that. Check the docs. Dont think
its supported in 1.0 though, just 1.1. (With each 1.1.x version having a
different interface!)

-----Original Message-----
From: Karl [mailto:karl@webartjapan.com]
Sent: Thursday, 13 March 2003 14:26
To: Struts Users Mailing List
Subject: One-time initializing in struts


Is there a way to do one-time initialization in struts without having to put
check logicn in every action?

I want to use turbine as my persistance back-end but I need to call
Torque.init("Torque.properties"); somewhere.


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


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


One-time initializing in struts

Posted by Karl <ka...@webartjapan.com>.
Is there a way to do one-time initialization in struts without having to put 
check logicn in every action?

I want to use turbine as my persistance back-end but I need to call 
Torque.init("Torque.properties"); somewhere.


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


RE: Dynamic form value replacements???

Posted by Jason Long <ja...@supernovasoftware.com>.
According to this you can.  I have not tried though.  Makes the other
constuctors obsolete.
http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionError.ht
ml

Do you know to use DynaActionForm?

I do not understand how to get the values kept when validation fails.  It
currently loses all changes because I do not know the name of all the text
fields beforehand and cannot create get and set methods.

Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS  Chemical Engineering

-----Original Message-----
From: Ian Hunter [mailto:ihunter@hunterweb.net]
Sent: Wednesday, March 12, 2003 8:43 PM
To: Struts Users Mailing List
Subject: Re: Dynamic form value replacements???


Can you put them in an array?

----- Original Message -----
From: "Jason Long" <ja...@supernovasoftware.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, March 12, 2003 9:38 PM
Subject: Dynamic form value replacements???


> I have a form that is dynamically created as a jsp in xml syntax.  There
are
> an arbitrary number of text fields that need to be validated.  Could
someone
> point me to an example of how to do this?  I have no way of creating the
set
> and get methods in the form class unless I dynamically create the java
code
> and recompile.  This is not an option.
>
> Thank you for your time,
>
> Jason Long - CEO and Chief Software Engineer
> Supernova Software - supernovasoftware.com
> BS Physics, MS  Chemical Engineering
>
> -----Original Message-----
> From: louis majanja [mailto:louis@ironpulse.com]
> Sent: Wednesday, March 12, 2003 6:27 PM
> To: Struts Users Mailing List
> Subject: [HELP] ActionMessages <html:messages />
>
>
> i have this in my actionForm:
> ActionMessages messages = new ActionMessages();
>
>    messages.add("message",
>                   new ActionMessage("message.login.confirmation"));
>   saveMessage(request,messages);
>
> in my jsp i have
>
> <html:messages />
>
> it doesn't work, i have tried the following options which don't work
> either
>
> <html:messages message="true"/>
>
> <html:messages id="msg" property="messages" message="true">
>   <c:out value="${msg}"/>
> </html:messages>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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



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


Re: Dynamic form value replacements???

Posted by Ian Hunter <ih...@hunterweb.net>.
Can you put them in an array?

----- Original Message -----
From: "Jason Long" <ja...@supernovasoftware.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, March 12, 2003 9:38 PM
Subject: Dynamic form value replacements???


> I have a form that is dynamically created as a jsp in xml syntax.  There
are
> an arbitrary number of text fields that need to be validated.  Could
someone
> point me to an example of how to do this?  I have no way of creating the
set
> and get methods in the form class unless I dynamically create the java
code
> and recompile.  This is not an option.
>
> Thank you for your time,
>
> Jason Long - CEO and Chief Software Engineer
> Supernova Software - supernovasoftware.com
> BS Physics, MS  Chemical Engineering
>
> -----Original Message-----
> From: louis majanja [mailto:louis@ironpulse.com]
> Sent: Wednesday, March 12, 2003 6:27 PM
> To: Struts Users Mailing List
> Subject: [HELP] ActionMessages <html:messages />
>
>
> i have this in my actionForm:
> ActionMessages messages = new ActionMessages();
>
>    messages.add("message",
>                   new ActionMessage("message.login.confirmation"));
>   saveMessage(request,messages);
>
> in my jsp i have
>
> <html:messages />
>
> it doesn't work, i have tried the following options which don't work
> either
>
> <html:messages message="true"/>
>
> <html:messages id="msg" property="messages" message="true">
>   <c:out value="${msg}"/>
> </html:messages>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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