The moose likes JSP and the fly likes JSP and Files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP and Files" Watch "JSP and Files" New topic

JSP and Files

Baba Bizlowsky
Ranch Hand

Joined: Dec 15, 2003
Posts: 39
Hi. Me again.

My JSP page has to log something in the file. For that purpose I have created a custom MyLogger class which has a static logging method. It receives a string, a name it should use for the file and it should create a file and put the string with logging info in it.

This MyLogger class, of course, resides in a WEB-INF/classes directory.

Upon testing it, however, I saw that the file gets created inside %TOMCAT_ROOT%/bin directory. Why? I thought that it would be created in an approppriate webapp directory, not there of all places...

How should I handle this?

Thanks in advance. Cheers!
Lavern Matthew
Ranch Hand

Joined: Jun 05, 2004
Posts: 38
the TOMCAT_HOME/bin is the current working directory. Take a look at

Matthew Wilson<br />-
Lavern Matthew
Ranch Hand

Joined: Jun 05, 2004
Posts: 38
Or better yet:
I agree. Here's the link:
subject: JSP and Files
jQuery in Action, 3rd edition