You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Lee Yeow Leong <le...@alum.comp.nus.edu.sg> on 2000/11/27 15:49:43 UTC
Dispatcher Question
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.
Re: Now, am I stupid or what?
Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
Craig R. McClanahan <Cr...@eng.sun.com> wrote:
>
> There is a message (from me) about the connector that *I* wanted you to read
> :-). It documents a couple of SOLARIS-isms that we probably need to fix, and
> the fact that I don't have complete docs for installing mod_webapp so that I
> can test it.
Read and replied to :)
> On the former topic, we probably need someone who is autoconf-savvy to make
> our build procedures for native code reasonably platform independent. Any
> volunteers?
NOOOOOOOOOOOOOOOOOO..... Please, let's try to avoid the use of
Autoconf/Automake... I HATE those tools, and we don't need them for the 2 or
3 extra unportable calls we have...
Pier
--
Pier P. Fumagalli Apache Software Foundation <ma...@betaversion.org>
----------------------------------------------------------------------------
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur,
adipisci velit... (Cicero: "De Finibus" 1.10.32)
Re: Now, am I stupid or what?
Posted by Jon Stevens <jo...@latchkey.com>.
on 11/27/2000 3:38 PM, "Craig R. McClanahan" <Cr...@eng.sun.com>
wrote:
> On the former topic, we probably need someone who is autoconf-savvy to make
> our
> build procedures for native code reasonably platform independent. Any
> volunteers?
(Hint) There is TONS of helpful and perfectly good working autoconf stuff in
JServ. :-)
-jon
--
twice of not very much is still a lot more than not very much
Re: Now, am I stupid or what?
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
"Pier P. Fumagalli" wrote:
> Ok, I don't know what's happening... I'm reading some of the messages to
> this list "in advance" (since I moderate and NOT all of you kids post
> with the same email address you are subscribed! GRRR!)...
>
> But, strangely enough, I've seen some messages talking about the
> connector this morning that I didn't receive... Did I miss something
> important?
>
It might be that I also moderate on TOMCAT-DEV, and might have pre-approved
them. I also note that some people appear to subscribe and then immediately
send a message, but the mailing system appears not to have updated its database
yet, so the message goes to the moderation queue anyway.
There is a message (from me) about the connector that *I* wanted you to read
:-). It documents a couple of SOLARIS-isms that we probably need to fix, and
the fact that I don't have complete docs for installing mod_webapp so that I can
test it.
On the former topic, we probably need someone who is autoconf-savvy to make our
build procedures for native code reasonably platform independent. Any
volunteers?
>
> Pier
>
Craig
Now, am I stupid or what?
Posted by "Pier P. Fumagalli" <pi...@betaversion.org>.
Ok, I don't know what's happening... I'm reading some of the messages to
this list "in advance" (since I moderate and NOT all of you kids post
with the same email address you are subscribed! GRRR!)...
But, strangely enough, I've seen some messages talking about the
connector this morning that I didn't receive... Did I miss something
important?
Pier
--
Pier Fumagalli <pi...@betaversion.org> <http://www.betaversion.org/~pier>
Re: Dispatcher Question
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Lee Yeow Leong wrote:
> 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).
>
You do not say which version of Tomcat you are trying this with, but both 3.2b8
and 4.0m4 correctly resolve to (b) if you execute this inside a servlet running
in the specified webapp. If you were running in the root context, of course,
(b) would be equivalent to (a).
Craig McClanahan