Recommended location of Resource Bundles for a Dynamic Web Project
I'm looking at restructuring an old Web Application.
I have extracted out all Java source files from 开发者_运维百科my Dynamic Web App and put them in a jar that gets added to the Web App WerContent/WEB-INF/lib when compiling using my build.xml.
So the intention is to only have my jsf/xhtml & resources files(js/css/images) in the web app.
The Jar also contains numerous java resource bundles properties files.
Is it standard practice to have these properties files in the Web App? What is the recommended location of them?Thanks
The resource bundles must be somewhere in the classpath of the webapp. Whether they're in WEB-INF/classes
, or in a jar of WEB-INF/lib
doesn't matter. What's important is that ResourceBundle.getBundle()
uses the classloader to load them.
I would put them in the same location as the classes using them.
精彩评论