File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JSP scriptlet in Bean:write tag

 
Amirr Rafique
Ranch Hand
Posts: 324
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How can we use JSP scriptlet in <bean:write> tag e.g.
<bean:message key="homepage.text.announcements.text.first"/> Can I do following
<bean:message key="homepage.text.announcements.text.first<%=institute%>"/>
Where <%institute%> is my variable having different values. Basically I wanna select key dynamically.

Anybody can please help

Regards
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The rule with scriptlets used in attributes of a Struts tag is "all or nothing", meaning the entire attribute must be a scriptlet, or no part of it can be a scriptlet.

Given this rule, the following should work:

<bean:message key='<%="homepage.text.announcements.text.first"+institute%>'/>
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic