Hey, that was also my problem a few weeks ago!
I made something like a general login servlet if a new session is
created, and stored the servlet url the user called for the first time.
But the problem is that a user can type the IP or only use the first
part of the server name if he/she is in the domain, exactly as Henner
explained.
Now I use the following to retrieve the requested url:
String query = req.getQueryString();
String uri = req.getRequestURI();
if (query == null)
query = "";
else
query = "?" + query;
return uri + query;
This makes sure that every parameter is passed to the doGet() method if
there were any.
Henner Zeller wrote:
> I once stumbled in this trap: I tested a servlet on my localhost with
> Netscape (I am not forced to give my own domain name, then):
> http://host/someservlet
> and made a redirect to another servlet, using part of the request URI ..
> The Servername of the Apache has been configured to be 'host.mydomain.com'
> so the redirect arrived at
> http://host.mydomain.com/redirect
> .. and the cookie was invalid since Netscape didn't sent it to this 'new'
> Host -> session invalid.
>
> Could this be your problem ?
>
> ciao,
> -hen
> ---
> Henner Zeller [EMAIL PROTECTED]
> PGP pub key [77F75B39]: finger [EMAIL PROTECTED]
>
> "One difference between SuSE and Red Hat is that the former operates in a
> country where people don't sue each other over coffee being too hot."
> Linus Torvalds
>
> -- --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> READ THE FAQ!!!! <http://java.apache.org/faq/>
> Archives and Other: <http://java.apache.org/main/mail.html/>
> Problems?: [EMAIL PROTECTED]
--
Guenther Wieser
creative-it/Guenther Wieser Software KEG
Student of Telematik at Graz University of Technology
http://www.creative-it.com mailto:[EMAIL PROTECTED]
-> In A World Without Walls And Fences, Who Needs Windows And Gates? <-
-- --------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]