permaculture playing cards*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "adding a value to bean:write property="???"" Watch "adding a value to bean:write property="???"" New topic
Author

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

satish jupalli
Greenhorn

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" />

</c:forEach>

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.
satish
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: adding a value to bean:write property="???"
 
Similar Threads
Unusual behaviour? - logic:iterate
Iterate through a ResultSet
help :how to get value from logic:iterate
How to find to which row is selected?
How to Use bean:write inside html:text