aspose file tools
The moose likes Servlets and the fly likes Current working directory for Servlet in Tomcat? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply 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: 5533

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: 56178
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56178
    
  13

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