This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Session attribute removes itself...

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

Now here's an interesting one for you. In my webbapp I came to a point where I have to keep an object into the user's session for a short period of time. I developed a session filter that automatically removes the attribute unless the requestURI() is in an "accepted uris list". The scenario looks like this: the user clicks a link in a jsp, the link takes him into some action that retrieves an object from the underlying repository and stores it in the user session and then forwards the response to the jsp page. And here comes the weirdness. By using an Internet Explorer browser the attribute removes itself as soon as it's stored (I used a SessionListener class to notify me upon session events). When using Mozilla Firefox the attribute remains in the user's session but when I hit F5 on the page it gets removed. I found out that this is because of the SessionFilter but here comes a question for all you Struts gurus - why ? The first time the page loads everything works fine, as soon as I hit refresh - the attribute is gone. What happens behind the curtains ?

Thank you all,
Dan
 
Daniel Platon
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem solved.
The difference in behaviors between IE and FF comes from the fact that IE refresh the page fully (requesting all the images and css again so the SessionFilter removes the attribute. I fine-tuned the filter to only consider the requestURIs that end with *.do.

Have a good day,
Dan
 
When all four tires fall off your canoe, how many tiny ads does it take to build a doghouse?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic