I'm new in JSF world, and I'm trying to attach internationalization into my web application. The problem is, I'm using Eclipse for learn, and (based on JSF in Action) the easiest way to put my properties file is within WEB-INF/classes. It works fine, but every time the project was cleaned up, I also lost my properties file. Is there any way to put my properties file into, let's say, WEB-INF/faces/locales and tomcat recognize it? I've tried to set java build path from project proeperties, but still I got this message:
which, unsurprisingly, disappear if i put my applicationBundle_en.properties directly under WEB-INF.
Any idea??
Pamungkas Timotius
Greenhorn
Joined: May 22, 2005
Posts: 26
posted
0
sorry, I meant under WEB-INF/classes
Michael Ku
Ranch Hand
Joined: Apr 20, 2002
Posts: 510
posted
0
The container is using your application's class path to find the resources. If you want to place them somewhere esle in youe application, add that path (location) to your classpath
Pamungkas Timotius
Greenhorn
Joined: May 22, 2005
Posts: 26
posted
0
how can i do that in eclipse?
Michael Ku
Ranch Hand
Joined: Apr 20, 2002
Posts: 510
posted
0
Its the classpath of your application server that needs to be set.
1. You can turn off the automatic cleanup option on builds
2. You can set up an additional builder that copies the file from a more stable location (I usually keep an "etc" folder in the project for stuff like this).
3. You can use Ant/Maven to do the actual building
I use the third approach most often (or 3+1), although solution 2 is perhaps the most elegant.
Customer surveys are for companies who didn't pay proper attention to begin with.
Pamungkas Timotius
Greenhorn
Joined: May 22, 2005
Posts: 26
posted
0
well, i'm trying to use my own ant script.. I think the script only need two steps:
1. copy my properties file from 'faces/locales' into 'WEB-INF/classes' 2. do the build (call eclipse build file...)
It's quite simple to do the first task, but what about the second? where is the build.xml for my project?
Denise L Smith
Greenhorn
Joined: Mar 04, 2006
Posts: 7
posted
0
if you're using eclipse you should be able to just put in a package that is in your Javasource folder - The IDE will build it into your classes file for you. Each time you build with your IDE it compiles your files and moves the files that are in your packages into you classes folder-check out your project navigator view!
The courage to learn anything...that's what I look for.