tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Yeow Leong <leeye...@alum.comp.nus.edu.sg>
Subject Dispatcher Question
Date Mon, 27 Nov 2000 14:49:43 GMT
  I'm experiencing some differences in the behaviour of Tomcat vs
Websphere and IAS.   

  Assuming that I have a web application called test.  Inside the code
of a servlet in the web application, I perform the following

-------------------------------------------------------------
  RequestDispatcher dispatcher = request.getRequestDispatcher("/");
  dispatcher.forward(request,response);
-------------------------------------------------------------


  Should the above the resolve to 

a) http://<hostname>/
b) http://<hostname>/<webapp context>/

   
  Websphere 3.5 and IAS6 resolves to (b), while Tomcat resolves to (a).
  
  I read the specification 2.1 & 2.2.  2.1 seems to talk nothing about
it, while 
version 2.2 says


-----------------------------------------------------------
The behavior of this method is similar to the method of the same name in
the ServletContext,
however it does not require a complete path within the context to be
given as part of the argument to
operate. The servlet container can use the information in the request
object to transform the given
relative path to a complete path. For example, in a context rooted at
’/’, a request to
/garden/tools.html, a request dispatcher obtained via
ServletRequest.getRequestDispatcher("header.html") will behave exactly
like
a call to ServletContext.getRequestDispatcher("/garden/header.html").
-----------------------------------------------------------

  But nothing seems to mention about how paths that begins with a "/"
ought to be resolved.

  What should be the desired behaviour? tia.

Mime
View raw message