Sorry I was not clear.
Am not asking how to display it in the JSP. This part is quite
straightforward.
What am wondering is how does struts manage the submission of form by user.
If I take the simple example where parameter[0] is to be holder a String and
parameter[1] to be the holder of a Person.
I assume generate this kind of form as result of jsp
<form (details on submission here)>
<input type="hidden" name="parameter[0].type" value="java.lang.String"/>
<input type="text" name="parameter[0].value" value="default content 0"/>
<input type="hidden" name="parameter[1].type"
value="com.mycompany.beans.Person"/>
<input type="text" name="parameter[1].value.firstname" value="default
firstname"/>
<input type="text" name="parameter[1].value.lastname" value="default
lastname"/>
</form>

I was thinking to have a form with an array of VariableParameter.
VariableParameter is a custome bean which have 2 properties.
One String for type and one 'Object' for the value.
Perhaps having value as a DynaBean which is then converted to
real type when type is known.
I know there are converter thingies in beanutils used by struts.
Am just wondering if there is an easy way to manage the final convertion
(probably during the validate step if struts is unable to handle it by
itself)
from a DynaBean to SomeCustomClass

thanks
Murray Collingwood a écrit :

>On reading this I initially thought you had an array of objects where each 
>object was a 
>group of objects such as a file, an int, a string etc.  Then I wondered 
>whether your array 
>of objects was just that, the first object a file, the second object an int, 
>the third object a 
>string etc.  Obviously this is more complicated.  It sounds as though you are 
>asking if 
>Struts has some sort of reflection....yes!
>
>It's called custom tag libraries.
>
>Pass the object to a custom tag library and deal with it appropriately.
>
>When you pass the object it will be just that, an object, unless you also pass 
>the type, 
>for example:
>Object object;
>String objectType;
><mylib:display obj="${attributeName.property1} " 
>objType="${attributeName.property2}"/>
>
>Kind regards
>mc
>
>
>On 21 Sep 2005 at 10:32, David Delbecq wrote:
>
>  
>
>>Hello,
>>
>>I'm seeking for help/documentation pointers on how to
>>manage custom data-types in struts.
>>Am wanting to know if it's possible to manage complex data-type
>>(that is data-types which need more than one field to be displayed / filled)
>>All this considering my form contains an array named parameters[]
>>with each parameter being either a File, an int, a String, a complex type.
>>
>>Thanks a lot.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>-- 
>>No virus found in this incoming message.
>>Checked by AVG Anti-Virus.
>>Version: 7.0.344 / Virus Database: 267.11.3/107 - Release Date: 20/09/2005
>>
>>    
>>
>
>
>
>FOCUS Computing
>Mob: 0415 24 26 24
>[EMAIL PROTECTED]
>http://www.focus-computing.com.au
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to