[opencms-dev] Setting Browser Cache directives

Marcus Redeker mredeker at web.de
Sun Mar 27 21:50:27 CEST 2005


All,

what is the policy of OpenCMS and settings for brwoser cache? I am having
trouble to get the pages displayed correctly because my browser is caching
dynamic pages. OpenCMS should set the pragma and cache header on the
response so that the browser (and maybe proxy) knows that they are not
allowd to cache the page.

I implemented some kind of login funtionality and after a login the username
should be displayed and not the login form anymore. But although the user
logged in successfully the login form is still displayed.

I am using the code below in my template to decide whether to display the
username or the login form.

Thanks,

--Marcus

======== Snippet ======================

<%	
  // Create a JSP action element
  CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);
  String currentUser = cms.user("name"); 
%>

<%
  if ( !currentUser.equals("Guest") )
  {
%>
          <!-- start logged in box -->
            <table cellspacing="0" class="login">
              <tr>
                <td style="width:180px;"> </td>
              </tr>
              <tr>
                <td><b class="involvaRed">Eingeloggt als
<%=currentUser%></b></td>
              </tr>
              <tr>
                <td class="logoutLink"><a href="?logout=yes">Logout</a> <a
href="?logout=yes"><img
src="<cms:link>../resources/images/logout.gif</cms:link>" width="16"
height="16" alt=""></a></td>
              </tr>
            </table>
          <!-- end logged in box -->
<%
  }
  else
  {
%>
          <!-- start log in box -->
            <form action='<%=cms.link("/login.jsp")%>' method="post">
            <table cellspacing="0" class="loginForm">
              <tr>
                <td style="width:180px;"> </td>
                <td>
                  <input class="login" type="text" name="username"
value="Benutzer" onfocus="this.value='';"><br>
                  <input class="login" type="password" name="password"
value="passwd" onfocus="this.value=''";>
                </td>
                <td style="padding-top:22px;"><input type="image"
src="<cms:link>../resources/images/go_button.gif")</cms:link>" width="18"
height="18" alt=""></td>
              </tr>
            </table>
            </form>
          <!-- end log in box -->
<%
  }
%>

============================




More information about the opencms-dev mailing list