A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
bean:define to define an array of Strings
Joined: Feb 13, 2006
Apr 19, 2006 15:49:00
I have a bean that has a list of names
the bean has name="companyNames" property="cName"
In the front end I want to manipulate these names for display purposes and so, want to do so using Java in the jsp page
Can I have this list in a Java
efine id="iNames" name="companyNames" type="java.lang.String" />
so that I can use the iNames array
<% System.out.println(iNames); %> in jsp
Is there any way to do this?
I hope I was clear in telling what I wanted..
Joined: Mar 17, 2006
Apr 20, 2006 03:58:00
Why don't you use the <logic:iterate> tag to iterate through the list of bean objects, and <bean:write> to display the cName property from the companyNames list.
For example -
<logic:iterate id="companies" name="companyNames"> <bean:write name="companies" property="cName"/> </logic:iterate>
Hope this helps.
"What's in a name? That which we call a rose by any other name would smell just as sweet."<br />(William Shakespeare, Romeo and Juliet, Act II, Scene II)
It is sorta covered in the
JavaRanch Style Guide
subject: bean:define to define an array of Strings
logic:iterate usage improvement needed
coping an Array from a formbean
displaying data from arrays with html:text
A JSTL doubt while assigning a variable using <c:set/>
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013