This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Pasted url vs link - extremely odd behavior Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Pasted url vs link - extremely odd behavior" Watch "Pasted url vs link - extremely odd behavior" New topic
Author

Pasted url vs link - extremely odd behavior

Claude Forkner
Greenhorn

Joined: Feb 19, 2006
Posts: 24
Hi all. I'm trying to figure out a real strange one. I have a struts 1.1 (I think) webapp. I have a filter that checks if the user has a valid session. I also have many classes, but the one I'm focusing on is called downloader.java. What it does is accept an itemID, and then does stuff (not that important for this question).

So, I started hearing from users that they can't paste a url into the browser and be taken to item. Instead it kicks them out to the login page. Let's say the url looks like mysite.com/downloader.do?itemID=848

So, I tested this by opening a fresh browser, and pasting in the link. The first thing that happens is that the filter kicks you to the login since you aren't logged in. This is expected behavior. Once you login, and THEN paste the url into the browser and hit enter, it kicks you back to the login page, but it isn't even hitting the filter. It's not even getting in there! That behavior ALWAYS happens in Internet Explorer. In Firefox, it often works corectly and takes you right to the download. On one version of firefox I tried, it will hit the filter, go to the right java class, but the request is empty...odd..and it only happens on one of my versions of firefox.

So here's where it gets weirder. If I put a link on the homepage that is a a href to the exact same link I'm pasting into the browser, then click it, it works! The href is pointing to the exact same url. So it appears by clicking the link, it will work, whereas entering it into the browser address bar wont.

Any thoughts? Weird caching going on? Perhaps there is something in struts or web programming I'm not aware of also. I'd love ideas. Thanks!
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
This sounds like browser caching.

- Brent
Gladwin Burboz
Greenhorn

Joined: Feb 26, 2008
Posts: 25
How do you perform authentication?
Do you have cookie or url based session tracking?

Looks to me like for some reason "jsessionid" is not being passed due to which it is not able to able to associate this request with same user session.


<a href="http://www.sealordresortarnala.com" target="_blank" rel="nofollow">http://www.sealordresortarnala.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pasted url vs link - extremely odd behavior
 
Similar Threads
Session attribute removes itself...
how to redirect to success page in tomcat using its lapd configuration
Struts 2 Setup question
Specify servlet filter to include all but one file
Problems migrating struts 1.38 webapp from tomcat 5.5->6.0