• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

resource bundle from JAR file?

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic