You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Hardin <CH...@emageon.com> on 2003/05/16 20:58:53 UTC
Accessing indexed properties from Struts
I have a bean tag
<bean:define id="meta" name="recon" property="queryMeta"/>
This object is an array.
Now I want to print only the second element in the array. How would I do this???????
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Accessing indexed properties from Struts
Posted by Vic Cekvenich <vc...@baseBeans.com>.
Doing bean define (and use bean) is a bad practice in Struts or MVC.
Beans should be created automatically by action mapping or in your action.
I use a formBean that implements a collection. You should unit test the
bean.next() to see if it works outside of Struts.
Then use the indexed tag documented on Struts html tag on
jakarta.apache.org / Struts (also on baseBeans.com Cheat Sheet page)
hth.
.V
Chris Hardin wrote:
>
>
> I have a bean tag
>
> <bean:define id="meta" name="recon" property="queryMeta"/>
>
> This object is an array.
>
> Now I want to print only the second element in the array. How would I do this???????
>
>
--
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA
Advanced <a href ="baseBeans.com">Struts Training</a> and project recovery in North East.
Open Source <a href ="baseBeans.com">Content Management</a> basicPortal sofware
Best practice<a href ="baseBeans.com">Struts Support</a> v.1.1 helper ScafflodingXPress
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org