wood burning stoves 2.0*
The moose likes Servlets and the fly likes Current working directory for Servlet in Tomcat? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Current working directory for Servlet in Tomcat?" Watch "Current working directory for Servlet in Tomcat?" New topic
Author

Current working directory for Servlet in Tomcat?

Jack Doson
Greenhorn

Joined: Oct 02, 2008
Posts: 9
when ever you want forward request to any jsp or other servlet from servlet will give some thing like this.>!

RequestDispather rd=request.getRequestDispather(/EmpDisplay.jsp);

rd.forward(request,response);

it means some how servlet container is running our application in main application folder(directory) of our directory..!

is it correct...?

Thanks for reading and Helping.!
[ October 02, 2008: Message edited by: Bear Bibeault ]

Jack Dososn..!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

If I understand you correctly, the answer is "yes."

If the path passed to getRequestDispather starts with a "/", then the location is relative to the root of the WAR archive.


JBoss In Action
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Not always. That may be true for JSPs, but servlets are mapped according to elements in the deployment descriptor and are not addressed relative to the file system.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

"Jack Doson", please check your private messages for an important administrative matter. Again!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Current working directory for Servlet in Tomcat?
 
Similar Threads
Distributed Container
jmeter results unrealistically fast
restarting the server
Dispatching a request
COnfused about ServletPath Vs PathInfo