Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

To Retrieve from a .properties File for the Value of a Custom Tag Attribute

 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying not to code any text in my JSP. For example, I have the text 'Maintain Events' stored in a .properties file. And I can retrieve that text using:

Now, I am using a custom tag called 'trail'. If I hard code the text 'Maintain Event' in that custom tag, I can do:

How do I modify the tag specification to retrieve 'Maintain Events' from the .properites file? Thanks.

[ May 12, 2006: Message edited by: Daniel Gee ]
[ May 12, 2006: Message edited by: Daniel Gee ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
one possibility would be to have your class extend org.apache.struts.taglib.bean.MessageTag. You could then borrow its functionality and add your own.

Another possibility would be to declare that your tag accepts run-time expressions, and then resolve the message and pass the message in through a scriptlet or EL expression.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic