struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juan Alvarado \(Struts List\)" <>
Subject Slightly off-topic
Date Tue, 30 Jul 2002 23:10:27 GMT
I am working on a struts app and need to accomplish the following...

Can anyone tell me (if they know) what I have to do to capture the page the
user requested.

I have in my web.xml:

In my go.jsp I want to retrieve the url the user requested. Since I am bound
to the 2.2 API, I can't call request.getRequesURL(). So I looked at the
source for that method and used it in my page.

StringBuffer url = new StringBuffer();
String scheme = request.getScheme();
int port = request.getServerPort();
if (port < 0)
    port = 80; // Work around bug

if ((scheme.equals("http") && (port != 80))
    || (scheme.equals("https") && (port != 443))) {
out.print("The URL requested was " + url.toString());

My problem is that the result of the above code gives me the name of the
error handler page (, when in
reality I need the page the user requested.

Ex: (Doesn't exist)
internally tomcat forwards to /error404/go.jsp. In that page is where I need
to retrieve the URL the user
requested( But with the code above
I get

Does anyone know how to accomplish this with the servlet 2.2 API.


Juan Alvarado
Internet Developer -- Manduca Management
AOL Instant Messenger:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message