wood burning stoves 2.0*
The moose likes Struts and the fly likes adding a value to bean:write property= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "adding a value to bean:write property="???"" Watch "adding a value to bean:write property="???"" New topic

adding a value to bean:write property="???"

satish jupalli

Joined: Apr 06, 2003
Posts: 10
Hi all,

I want to concatenate the empFirstName with empno and set it as a property for bean:write. please suggest me a way out after having look at the following code.

<c:forEach var="empNo" begin="1" end="${numberOfEmployees}">

<bean:write name="EmpInfoForm" property="empFirstName (concatinate the empNo here so that it will become a property)" filter="true" />


Is there is any way i can do it, without writing a separate scriptlet.

something like
<bean:write name="EmpInfoForm" property=
"empFirstName${empNo} " filter="true" />

Thx in advance.
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
i think you missed the basic of c:forEach and c ut using simple Collection and java beans. you are forcing iteration through counter index instead of using the iterators supported by JSTL. please see http://javaboutique.internet.com/tutorials/Struts_EL/ for better approaches.

-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
It is sorta covered in the JavaRanch Style Guide.
subject: adding a value to bean:write property="???"
Similar Threads
help :how to get value from logic:iterate
How to Use bean:write inside html:text
Unusual behaviour? - logic:iterate
How to find to which row is selected?
Iterate through a ResultSet