File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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>
 
Don't get me started about those stupid light bulbs.
 
subject: Pasted url vs link - extremely odd behavior