Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Newbie: publishing a file to a tomcat server
Newbie: publishing a file to a tomcat server [message #228671] Fri, 06 March 2009 12:28 Go to next message
Jonathan O'Donovan is currently offline Jonathan O'Donovan
Messages: 5
Registered: July 2009
Junior Member
Hi,
I have a log4j.properties file that I would like to end up in the
WEB-INF/classes
directory after publishing. How do I configure publish to achieve this?

Many thanks,
Jonathan.
Re: Newbie: publishing a file to a tomcat server [message #228702 is a reply to message #228671] Mon, 09 March 2009 07:32 Go to previous messageGo to next message
Eclipse User
Originally posted by: wknauf_NO_._INSIDE_hg-online.de

Hi Jonathan,

place it in the "src" directory of your web project. Then it will be copied to
"classes".

Best regards

Wolfgang

Jonathan O'Donovan schrieb:
> Hi,
> I have a log4j.properties file that I would like to end up in the
> WEB-INF/classes
> directory after publishing. How do I configure publish to achieve this?
>
> Many thanks,
> Jonathan.
>
Re: Newbie: publishing a file to a tomcat server [message #228709 is a reply to message #228702] Mon, 09 March 2009 10:07 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3146
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Jonathan,

You can certainly place a file like "mystuff.properties" in a directory
under "src", like "config" or "properties", etc. if you find that to be
better organization. Where you put it will influence the arguments you
pass to:

ResourceBundle bundle = ResourceBundle.getBundle( "config" );

If you open it for reading by hand, you'd be using a path argument to
such as:

File f = new FileInputStream( "src/config/mystuff.properties" );

but that's from Eclipse during testing from Run As... or Debug... and
would be different once deployed (one reason to use getBundle()).

It's vaguely confusing at first; I know because I've only learned this
in the last few months. And, I'm probably still confused on many points.
In your case, it's the file controlling how logging works. That's
already set up in my app and I didn't do that aspect of it, so you'll
have to consult the log4j documentation on how to accommodate placing
this file in a subdirectory, but directly under "src" is one of the
places Loader.getResource( String ) looks for that file when it's opened
and read by log4j. See http://logging.apache.org/log4j/1.2/manual.html
about 3/4 of the way down the page.

Best of luck,

Russ Bateman


Wolfgang Knauf wrote:
> Hi Jonathan,
>
> place it in the "src" directory of your web project. Then it will be
> copied to "classes".
>
> Best regards
>
> Wolfgang
>
> Jonathan O'Donovan schrieb:
>> Hi,
>> I have a log4j.properties file that I would like to end up in the
>> WEB-INF/classes
>> directory after publishing. How do I configure publish to achieve this?
>>
>> Many thanks,
>> Jonathan.
>>
Previous Topic:Create an editor who extend the HTML WTP editor
Next Topic:Custom Ant Publisher for JBoss 4.2 Server
Goto Forum:
  


Current Time: Wed Aug 20 04:55:48 EDT 2014

Powered by FUDForum. Page generated in 0.02724 seconds