• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic