Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add .properties file to servlet

 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello , I want to work with log4J.properties file in servlets .

The resource bundle must be on the CLASSPATH for that running Servlet.

So for this do i need to set the properties file in Run Configurations -->Classpath tab or anywhere else ??



and also i kept my file in the lib directory of my web application.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You forgot to mention the IDE in question.

At any way, all you need is to place it in a folder which is (by default) covered by the application's classpath. In case of a webapplication it is usually the /WEB-INF/classes and /WEB-INF/lib and also the /appserver/lib (exact path depends on the appserver in question).

Do you understand the meaning of "classpath" at any way?
 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The IDE is Eclipse 3.1

Okay , Please tell me the difference between the server classpath and client side classpath ??

If i set any classpath on to the Eclipse IDE will this be a client side or to Server Side??

and whether it is required where should i need to add log4j.jar in my webapplication lib folder , or in server bin lib folder and also do i need to refer to this properties file in catilina.bat file if the server is Tomcat ??

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question makes no sense. There is no means of "server side" and "client side" when talking about the classpath.

Just put the file in the classpath of the running environment.
 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Thanks ,
If my application is a ear , then where should i keep my log4j.jar file as EJB's must also refer to it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic