You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Dr. Evil" <dr...@sidereal.kz> on 2001/10/24 07:04:45 UTC

getNamedDispatcher

Hi, I am trying to use ServletContext.getNamedDispatcher(String) to get
a RequestDispatcher object in my servlet.  The goal of this is to
allow my controller servlet to hand off request processing to another
servlet.  What I have done is set up a default <servlet-mapping> in my
web.xml file, so that all requests going to the server will be handled
initially by a controller servlet, which will then decide which
servlet should really handle the request.  It will go through its
logic and then come up with a string, which will be the real servlet
which will handle the request.

I'm trying to use getNamedDispatcher so that I can avoid the loop that
would happen because of the default servlet-mapping.  This seems like
it should work.

In my servlet's init method, I do this:

   this.context = getServletConfig().getServletContext();

This works.  context is not null after this call, so it definitely
gets a context.

However, later when I do:

	     RequestDispatcher rd =
	     this.context.getNamedDispatcher("/static/index.html");

rd comes back as null, and obviously rd.forward(request, response) is
impossible.

Any sugestions on this?  How do I get a servlet to send something to a
named servlet without going through the servlet-mappings again?

Thanks

Re: Where is 4.0.1 ?

Posted by Remy Maucherat <rm...@home.com>.
> Watching Tomcat 4 download site, I only find Jakarta-tomcat-4.0 binaries
> (17-Sep-2001)
> 
> Where are the October Jakarta-tomcat-4.0.1 binaries ?

Somebody screwed up the website. I just fixed the Tomcat 4 related links.

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Where is 4.0.1 ?

Posted by Dom <do...@free.fr>.
Watching Tomcat 4 download site, I only find Jakarta-tomcat-4.0 binaries
(17-Sep-2001)

Where are the October Jakarta-tomcat-4.0.1 binaries ?

Dom


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


isapi_redirect does not pass certificate in javax.servlet.request.X509Certificate

Posted by Kar YEOW <ka...@apir.com.au>.
How do you get isap_redirect to pass the client certificate to tomcat?
Anyone?
TIA.
Kar



tomcat session issue

Posted by Rinku Randhawa <rr...@compunetix.com>.
Hi there,

I am using jakarta-tomcat - 3.2.3 server to run my project. I am finding
that session tracking, when more than one browser window is opened at one
time, doesn't come out to be correct. I am using its inbuilt session object
and the cookies are enabled in my browser. When more than one sessions are
running then the page presented is unpredictable.Sometimes correct page
displays and sometimes totally diferent page gets displayed. It works great
except if I have 2 browsers sessions up - then it gets confused and losses
track of which is the current session.

Are there any issues with the Tomcat server regarding session tracking?

Thanks in advance,
-Rinku


Re: tomcat session problem

Posted by "Craig R. McClanahan" <cr...@apache.org>.
It's more likely to be a problem with your application, or a
misunderstanding of how browsers handle cookies.

In general, cookies are *not* specific to a particular browser window.
Therefore, all windows that the client has open are part of the same
session.  This is the way Netscape (at least 4.7.x) always runs -- but in
IIS it's configurable.  But the bottom line is that you cannot expect each
window to be running in its own session.

Craig


On Wed, 24 Oct 2001, Rinku Randhawa wrote:

> Date: Wed, 24 Oct 2001 14:46:25 -0400
> From: Rinku Randhawa <rr...@compunetix.com>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: tomcat session problem
>
> Hi there,
>
> I am using jakarta-tomcat - 3.2.3 server to run my project. I am finding
> that session tracking, when more than one browser window is opened at one
> time, doesn't come out to be correct. I am using its inbuilt session object
> and the cookies are enabled in my browser. When more than one sessions are
> running then the page presented is unpredictable.Sometimes correct page
> displays and sometimes totally diferent page gets displayed. It works great
> except if I have 2 browsers sessions up - then it gets confused and losses
> track of which is the current session.
>
> Are there any issues with the Tomcat server regarding session tracking?
>
> Thanks in advance,
> -Rinku
>
>
>


tomcat session problem

Posted by Rinku Randhawa <rr...@compunetix.com>.
Hi there,

I am using jakarta-tomcat - 3.2.3 server to run my project. I am finding
that session tracking, when more than one browser window is opened at one
time, doesn't come out to be correct. I am using its inbuilt session object
and the cookies are enabled in my browser. When more than one sessions are
running then the page presented is unpredictable.Sometimes correct page
displays and sometimes totally diferent page gets displayed. It works great
except if I have 2 browsers sessions up - then it gets confused and losses
track of which is the current session.

Are there any issues with the Tomcat server regarding session tracking?

Thanks in advance,
-Rinku



Re: getNamedDispatcher

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Doing this trick with servlet mappings is pretty much doomed to failure,
as you have discovered, because servlet mappings are applied to the
lookups of request dispatchers as well.

I suggest you look at using Filters (from the servlet 2.3 API) instead.
For instance, you can have a Filter that is mapped to "/*" (and therefore
sees every single request), without disrupting what servlets are mapped to
the various paths.  In the Filter, you can make the choice to just pass
the request on, or use a request dispatcher to redirect it somewhere else.

Craig


On 24 Oct 2001, Dr. Evil wrote:

> Date: 24 Oct 2001 05:04:45 -0000
> From: Dr. Evil <dr...@sidereal.kz>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: getNamedDispatcher
>
>
> Hi, I am trying to use ServletContext.getNamedDispatcher(String) to get
> a RequestDispatcher object in my servlet.  The goal of this is to
> allow my controller servlet to hand off request processing to another
> servlet.  What I have done is set up a default <servlet-mapping> in my
> web.xml file, so that all requests going to the server will be handled
> initially by a controller servlet, which will then decide which
> servlet should really handle the request.  It will go through its
> logic and then come up with a string, which will be the real servlet
> which will handle the request.
>
> I'm trying to use getNamedDispatcher so that I can avoid the loop that
> would happen because of the default servlet-mapping.  This seems like
> it should work.
>
> In my servlet's init method, I do this:
>
>    this.context = getServletConfig().getServletContext();
>
> This works.  context is not null after this call, so it definitely
> gets a context.
>
> However, later when I do:
>
> 	     RequestDispatcher rd =
> 	     this.context.getNamedDispatcher("/static/index.html");
>
> rd comes back as null, and obviously rd.forward(request, response) is
> impossible.
>
> Any sugestions on this?  How do I get a servlet to send something to a
> named servlet without going through the servlet-mappings again?
>
> Thanks
>