• Post Reply Bookmark Topic Watch Topic
  • New Topic

resource bundle from JAR file?  RSS feed

 
Darien Cheung
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is it possible to use a resource bundle located inside a JAR file? For example, I have a resource bundle called ApplicationResources.properties inside a JAR file called common.jar, and it is located in the package com/myApp/resources/. In the struts-config.xml, I defined the <message-resources parameter="com.myApp.resources.ApplicationResources"/> and placed the common.jar into the WEB-INF/lib directory.

When I start Tomcat and load the webpage, it complains the bundle is missing. Is WEB-INF/lib not part of the classpath?

Thanks
 
Jim Hardin
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jar(ring) up your WebApp release components and putting them in WEB-INF/lib works the same as leaving them expanded in WEB-INF/classes. The only difference is that the container does look in WEB-INF/classes before WEB-INF/lib. Putting your resource bundle in a jarfile in WEB-INF/lib is not a problem. What happens when you "jar -tvf common.jar" or try opening common.jar from WinZip. Is your "ApplicationResources.properties" really in folder com/myApp/resources? This should work fine--something else is going on...
-Jim
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!