File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Daniel Gee
Ranch Hand
Posts: 202
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic