• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing tomcat default working directory

 
Vishal Sinha
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vishal Sinha
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This problem comes when we using linux platform.
But in windows operating system you will get right path
%tomcat_home%/webapps/application
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic