Without digging, I can't say if its a bug. BUT... There is no need to encode the URL if the action is a RequestDispatcher.forward(). Only one session may be associated with the live of a single request so once the session is there in the request, its there no matter how many times in the same request you do a RequestDispatcher.forward(). Encoding the URL is only needed for sending redirects back to the client or for links on pages. (When the client is not accpeting cookies or hasn't yet receieved its first cookie)

-Tim

John Sidney-Woollett wrote:
I think that there may be a bug in TC 5.0.18 when issuing a
RequestDespatcher.forward with an URL that has the jsessionid encoded in
the URL. My setup is RH 8, JDK 1.4.2_03 + Apache 1.3.29 + mod_jk + TC
5.0.18.

I have a servlet (mapped in web.xml to /home/*) which catches all URLs
starting with "/home/". The servlet "looks" at the URL to work out which
JSP page to render by forwarding to it. The service method code is as
follows:

String fwdURL = "/en/home/welcome.jsp";

//create the request dispatcher (for the new URL)
RequestDispatcher rqdD =
request.getRequestDispatcher(response.encodeURL(fwdURL));

//and forward the request
rqdD.forward(request, response);

Here is the error produced by TC

HTTP Status 404 -
/en/home/welcome.jsp;jsessionid=35CC14009BCF7CCED835634586378F46

type Status report

message /en/home/welcome.jsp;jsessionid=35CC14009BCF7CCED835634586378F46

description The requested resource
(/en/home/welcome.jsp;jsessionid=35CC14009BCF7CCED835634586378F46) is not
available.
Apache Tomcat/5.0.18

Is this a bug, or am I doing something wrong. Maybe I should not be
encoding the forwarded URL. The bug manifests itself when switching from
an SSL to a non-SSL connection, or when cookies are turned off.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to