• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic