struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Cavaness <chuckcavan...@attbi.com>
Subject Re: Struts 1.1 b1 and how to set form-property initial value for java.util.List
Date Thu, 25 Apr 2002 11:44:16 GMT
I don't really think the framework is setup to do what you want it to do. 
The "initial" attribute is really designed to be a primitive. The 
ConvertUtils "convert" method is not really capable of doing what you want 
it to do. You'll probably have to extend the FormPropertyConfig class and 
override the initial() method and a few other things to do that. Shouldn't 
be too bad, but the current framework will probably not handle your situation.

I could be wrong, it's happened before. But this is how I understand it to 
work, looking at the source. I definitely should make this a note in the 
book, eh?

Chuck Cavaness

At 04:34 PM 4/25/2002 +1000, you wrote:
>Hi,
>
>I have not located too many examples on setting the intial bean value for
>types in the form-property tag other than java.lang.String.  I would like to
>set the initial value in a java.util.List.  Is this possible? if so, how do
>I do it?
>
><struts-config>
><!-- Bean Definitions -->
><form-beans>
>     <form-bean name="directoryForm"
>type="org.apache.struts.action.DynaActionForm">
>     <form-property name="dbLocation" initial="directorylocation"
>type="java.lang.String"/>
>     <form-property name="updatedBy" initial = "???" type="java.util.List"/>
>     ...
>
>Thanks in advance for any help.
>
>Craig Laverty.
>
>
>--
>To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


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


Mime
View raw message