Banishing Browser Caching in WebLogic Portal 10.3.2

I had a problem the other day where a user that was logged out still had their name showing on the screen. I thought the session wasn’t being invalidated, but it was actually a case of the browser caching the page. Digging around, I found a solution that, when added to a backing file for the desktop to run during pre-render did the trick:

import com.bea.netuix.servlets.controls.content.backing
               .JspBacking;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class NoCacheBacking implements JspBacking

{
   public void dispose(){}
   public boolean handlePostbackData(HttpServletRequest request,
      HttpServletResponse response)
   {

      return false;
   }

   public void init(HttpServletRequest request,
      HttpServletResponse response){}
   public boolean preRender(HttpServletRequest request,
      HttpServletResponse response)
   {
      response.setHeader("Cache-Control" ,
                   "no-cache, must-revalidate");
      response.setHeader("Pragma", "no-cache");
      response.setHeader("Cache-Control","no-store");
      response.setDateHeader ("Expires", 0);

      return false;
   }
}
If you found this interesting, please share.

© Scott S. Nelson

3 thoughts on “Banishing Browser Caching in WebLogic Portal 10.3.2

  1. eigentor December 28, 2011 / 11:03 pm

    excellent… however I can’t find instructions for adding backing file to skeleton jsps. How did you do it?

  2. eigentor December 28, 2011 / 11:31 pm

    I should clarify…. how to add backing file to a desktop created in the admin console, as opposed to the .portal file.

  3. Scott Nelson Scott Nelson December 29, 2011 / 9:18 am

    You must add the backing file at design time to a .portal file and then create a streaming desktop in the admin console based on that .portal file. All desktops created from the .portal file will have the backing file.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.