• 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

How can this be done better (html:link)

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've got a generic page and I'd like to pass text in to be displayed at the top. My Action class puts the Resource into the session:
HttpSession session = request.getSession();
session.setAttribute("logon_message", "k35.logon.postad");
I'd ideally like to be able to write a single tag that would write the String that corresponds to k35.logon.postad in my Application Resources file. Can anybody suggest an improvement on the following?
<logic resent name="logon_message">
<p class="heading">
<bean:message key="<%=session.getParameter("logon_message")%>"/>
</p>
</logic resent>
 
tumbleweed and gunslinger
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not have your action class hit the resource bundle and place the actual "message" in session, rather than the name?
That way, in the JSP file, you would just have:

Better yet, place it in page or request scope, unless you have a specific reason to place it in session.
[ December 12, 2003: Message edited by: David Yutzy ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic