tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: HTTP status 404 - only first time when accessing from browser
Date Tue, 09 Feb 2010 21:03:29 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To whom it may concern,

On 2/9/2010 3:17 PM, lazyisgood wrote:
> 1. In a new browser window, go to 
> http://subash.redirectme.net:8080/stock/faces/welcome.jspx
> The url in the browser can be seen as:
> "http://subash.redirectme.net:8080/stock/faces/welcome.jspxhttp://subash.redirectme.net:8080/stock/faces/;jsessionid=<someNUM>?_afrLoop=1<someNUm>&_afrWindowMode=0&_afrWindowId=null"

That's odd. Let's see what happens:

1. Request is made for
"http://subash.redirectme.net:8080/stock/faces/welcome.jspx"
2. Server responds with 200 OK w/Set-Cookie JSESSIONID header
3. Client requests
"http://subash.redirectme.net:8080/stock/faces/welcome.jspxhttp://subash.redirectme.net:8080/stock/faces/;jsessionid=8EEDF59F86BEC61AF9E0FCC299482BCE?_afrLoop=1452271788441692&_afrWindowMode=0&_afrWindowId=null"
4. Server responds with 404 Not Found

> 2. Now, delete the URL and again go to
> http://subash.redirectme.net:8080/stock/faces/welcome.jspx
> in the same browser. The page loads fine.
> 
> 3. Close the browser window and repeat step 1, the problem appears again.

Clearing the cookie allows you to reproduce this problem without
restarting the web browser. So, something happens with a live cookie
that allows this to work. I suspect it's an image.

Let's see what wget gives us.

Okay, a request to
"http://subash.redirectme.net:8080/stock/faces/welcome.jspx" results in
a page full of javascript. The last few lines of javascript in the page
look like this:

=========================================================
var sess =
"http://subash.redirectme.net:8080/stock/faces/;jsessionid=3B2C036C566B9EEAB4A26965D80C6F62";

if (sess.length > 0)
  href += sess;

/* if pprNav is on, then the hash portion should have already been
processed */
if ((false) || (hash == null))
  document.location.replace(href + query);
else
  document.location.replace(href + query + "#" + hash);
</script><noscript>This page uses JavaScript and requires a JavaScript
enabled
=========================================================

It looks like your Javascript code has failed to correctly parse the URL
for session information. I would remove the 'document.location.replace'
call temporarily and see what's wrong with your javascript code.

Note that you can so a lot of this type of stuff on the server, and it
might be a bit more clean.

Good luck,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktxzaEACgkQ9CaO5/Lv0PBG2ACghxFrvbvSIQ5WjSMYxJbR/c4U
yH4AnjR0AzE4tIyb2dZ8sEc9Q4u0h3HK
=Vnwz
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message