aspose file tools*
The moose likes Tomcat and the fly likes Changing tomcat default working directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Changing tomcat default working directory" Watch "Changing tomcat default working directory" New topic
Author

Changing tomcat default working directory

Vishal Sinha
Greenhorn

Joined: Jul 17, 2008
Posts: 6
Hello,
In my web application when I do (new File(".").getAbsolutePath()) the path returned is <tomcat_home>/bin directory. I want to change it to <tomcat_home>/webapps/<app_name> directory. Basically, I want to change the default directory for my web application to app directory.

Please let me know how to do it.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Web applications have no concept of a "current directory". You'll need to find another way to accomplish what you are trying to do, whatever that is.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vishal Sinha
Greenhorn

Joined: Jul 17, 2008
Posts: 6
Can someone let me know how to accomplish it. I want the webapp root directory in my application. How can I do it?
Java helper
Greenhorn

Joined: Dec 22, 2008
Posts: 1
This problem comes when we using linux platform.
But in windows operating system you will get right path
%tomcat_home%/webapps/application


<a href="http://www.easywayserver.com/jsp/JSP-Tutorial.htm" target="_blank" rel="nofollow">JSP Tutorial</a> | <a href="http://www.easywayserver.com/jdbc/JDBC-tutorial.htm" target="_blank" rel="nofollow">JDBC Tutorial</a>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

"Java helper", please check your private messages for an important administrative matter.

And please do not dredge up older posts. Please read this for more information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Changing tomcat default working directory
 
Similar Threads
Can't find Servlet in a new webapp
/hibernate.cfg.xml not found
Advice on deploying WAR file
Failed to load users/passwords/role files
Servlet can't find intialisation paramters