This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
satish jupalli
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!