• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Back button problem on logout

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Struts1.2 framework.
On logout I call LoginAction which invalidate session.
The problem is browser's back button problem as users information remains.
I have read posts related to this which mentions setting headers in response object like Cache-Control,Expires and Pragma.
But I have lots of jsp pages, so do I need to include part of setting response header in all jsp pages? Is there any better option to do this at one place?
Also I tried setting "controller" tag in Struts-Config.xml where "noCache" can be specified but there are some static jsp pages for which there is no action written and these are called directly using anchor tag, so facing same back button problem for these pages. Do I need to change calling of static jsp pages?
I want central point to control this, dont want to set response headers on each jsp page. How do I solve this?

Thanks
Deepa
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like you've already explored most of the options that are available to you. In my opinion, setting "noCache" in the controller stanza of the struts-config.xml file is the best option in spite of the drawback you mentioned. One possible workaround for the static pages is to have them served directly from your HTTP Server. In a typical production installation, there is an HTTP Server up front which forwards to the Application server. You could simply keep all your static content in the HTTP Server's context.
 
Deepa More
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You could simply keep all your static content in the HTTP Server's context.


What do you mean by this?
I am using Apache tomcat5 server and back end as MySQL db.
Do you mean the call to static pages has to undergo via struts-config.xml
i.e. there might be some forward to call these pages?
Or anything else?
Please explore.

Thanks
Deepa
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm used to working with IBM's WebSphere Application Server. In the topology most often used there is a separate Apache HTTP Server that in turn forwards requests to the application server. This Apache Server can serve static pages without forwarding to the app server. It would be set up so that any URI with a suffix of ".do" or ".jsp" gets forwarded to the app server, but other requests would be served from the static server. You would then set up a folder in the HTTP Server's context with the same name as your Struts application. That way the page http://myserver.com/myApp/mystaticPage.html would be served from the HTTP Server and the page http://myserver.com/myApp/mydynamicpage.jsp would be served from the app server. You could then easily use the static page URL as a forward in your Struts application. If you did this, the Struts "noCache" directive would not apply to the static pages.

I believe you could set up such a topology with Tomcat, but I'm afraid I don't know the details of how to do it.
[ April 21, 2008: Message edited by: Merrill Higginson ]
 
Deepa More
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply.
I solved my problem with the help of these posts:
http://www.symphonious.net/2007/06/19/caching-in-tomcat/
and
https://coderanch.com/t/290800/JSP/java/Invalid-url-pattern-filter-web
I used filter concept of servlet.

Thanks
Deepa
[ April 24, 2008: Message edited by: Deepa More ]
 
Oh the stink of it! Smell my tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic