Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

resource bundle from JAR file?

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

Is it possible to use a resource bundle located inside a JAR file? For example, I have a resource bundle called 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?

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 "" really in folder com/myApp/resources? This should work fine--something else is going on...
    Bookmark Topic Watch Topic
  • New Topic