aspose file tools*
The moose likes Struts and the fly likes To Retrieve from a .properties File for the Value of a Custom Tag Attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "To Retrieve from a .properties File for the Value of a Custom Tag Attribute " Watch "To Retrieve from a .properties File for the Value of a Custom Tag Attribute " New topic
Author

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

Daniel Gee
Ranch Hand

Joined: Aug 29, 2003
Posts: 202
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

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To Retrieve from a .properties File for the Value of a Custom Tag Attribute