tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: Resource Bundle Problem (sometimes)
Date Tue, 26 Jun 2007 14:43:12 GMT
Quoting Marius Botha <mariusbotha76@gmail.com>:

> Hi there,
> 
> I have my own tag (extending BodyTagSupport) in which I do the following:
> 
> <code>
> ResourceBundle resources = ResourceBundle.getBundle("application");
> out.print(resources.getString("key"));
> </code>
> 
> This works great ... most of the time. However, the moment I put this tag
> into another tag that I wrote (a Data Table Tag - extending LoopTagSupport)
> I get the following exception(below). For some reason it seems to find the "
> application.properties" resource file when my tag is on its own somewhere on
> the JSP, but when I try to use it in another tag, it doesn't work. Any
> ideas?
> 
> Much appreciated.
> 
> Marius Botha
> 
> Exception:
> java.util.MissingResourceException: Can't find resource for bundle
> java.util.PropertyResourceBundle, key
> java.util.ResourceBundle.getObject(ResourceBundle.java:326)
> java.util.ResourceBundle.getString(ResourceBundle.java:286)
> com.workpool.struts.component.html.MessageTag.doEndTag(MessageTag.java:32)

The stack trace seems to indicate that the property file is located just fine,
but that the file does not contain a key called "key". If the property file
could not be located, ResourceBundle.getBundle() should be throwning the
exception, not ResourceBundle.getString().

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message