-
1. Re: ResourceBundle
neillamoureux Sep 17, 2001 12:49 AM (in response to micael)I have no problem with using a resource bundle, although I place it in war file under WEB-INF/classes/. The war file is added to my ear file, which is then placed in JBoss' deploy directory. However, if you want to still place it under webapps, try webapps/"yourServletContext"/WEB-INF/classes/
-
2. Re: ResourceBundle
jperson Sep 20, 2001 12:13 PM (in response to micael)I am having the same problem..I have tried putting the ".properties" file everywhere and yet no luck
-
3. Re: ResourceBundle
hairylemon Oct 16, 2001 11:46 AM (in response to micael)Has anyone managed to find out what the problem is here? I have a properties file and I know I have its directory set up in the classpath but I still get the MissingResource exception.
-
4. Re: ResourceBundle
micael Oct 21, 2001 12:43 AM (in response to micael)I finally solved this problem by putting the properties files at WEB-INF/classes/props.properties.
But, I don't know why that should make any difference. -
5. Re: ResourceBundle
hairylemon Oct 22, 2001 10:04 AM (in response to micael)I don't know either. That web-inf directory is used for web servers isn't it? I'm just running a straightforward GUI application which needs to access a properties file. It looks like it needs more than simply being in a classpath directory but whatever it is, I have no clue.
-
6. Re: ResourceBundle
dojeff May 8, 2003 9:18 PM (in response to micael)I met the same problem on JBoss3.0.4_Tomcat4.0.6.
I follow your way to put all of the properties files under WEB-INF/classes/props.properties and use messages = ResourceBundle.getBundle("MessagesBundle"); in JSP page, then I still get error message: "org.apache.catalina.jsp_file : /Error.jsp
javax.servlet.jsp.jspException : java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key" -
7. Re: ResourceBundle
raja05 May 9, 2003 10:27 AM (in response to micael)If ur .properties is definitely in ur classpath, try this
ResourceBundle bundle = ResourceBundle..getBundle(, , getClass().getClassLoader());
-Raj -
8. Re: ResourceBundle
aalmero Oct 10, 2003 8:56 AM (in response to micael)I tried to use the code below but i still got the same error when using it inside a java class. but when i tried it using in a jsp file it worked.
need help on this one. thanks
alex -
9. Re: ResourceBundle
aalmero Oct 10, 2003 10:14 AM (in response to micael)I finally figured it out.
ENV: win2000,jboss3.2.1,tomcat4.1.24
i just moved my *.properties on <JBOSS_HOME>/server/default/conf and the following codes below worked.
ResourceBundle rb = ResourceBundle.getBundle("MyPropeties");
rb.getString("db");
....
alex