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
posted Oct 02, 2008 17:07:00
0
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
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
"Jack Doson", please check your private messages for an important administrative matter. Again!
subject: Current working directory for Servlet in Tomcat?