• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing tomcat default working directory

 
Vishal Sinha
Greenhorn
Posts: 6
  • 0
  • 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: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic