aspose file tools
The moose likes JSF and the fly likes Intenationalization JSF using Tomcat & Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Intenationalization JSF using Tomcat & Eclipse" Watch "Intenationalization JSF using Tomcat & Eclipse" New topic
Author

Intenationalization JSF using Tomcat & Eclipse

Pamungkas Timotius
Greenhorn

Joined: May 22, 2005
Posts: 26
Hi...

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:

org.apache.jasper.JasperException: java.util.MissingResourceException: Can't find bundle for base name applicationBundle, locale en

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
sorry, I meant under WEB-INF/classes
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
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
how can i do that in eclipse?
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
Its the classpath of your application server that needs to be set.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14475
    
    7

There's a couple of approaches.

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
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
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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Intenationalization JSF using Tomcat & Eclipse
 
Similar Threads
Referencing images in a servlet
[Eclipse Web Tools Project] Handling Libraries
trouble with an example servlet
SQL statements in files in jars - best practice suggestions?
JARs needed by Tomcat