[opencms-dev] Disappearing nav links...[Scanned]
Claus Priisholm
cpr at codedroids.com
Fri Jan 13 20:58:30 CET 2006
If you can see relevant bits and piece of JSP be cached in the flex
cache (in administration) then that is probably the problem. You can
make cached variants based on either the user or group (or you can set
cache to never).
>
>
>
> Here’s the code for my login element:
>
>
>
> <code>
>
> <%@ page session="false"
> import="java.util.*,org.opencms.jsp.*,org.opencms.file.*" %>
>
> <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
>
> <%
>
> //get the required OpenCms Object
>
> CmsJspActionElement cms = new CmsJspActionElement(pageContext,
> request, response);
>
> CmsObject cmso = cms.getCmsObject();
>
>
>
> //variables to catch the parameters from the request
>
> String username = "";
>
> String password = "";
>
> String action = request.getParameter("action");
>
> String requestedResource =
> request.getParameter("requestedResource");
>
>
>
> //catch the parameters if the user is trying to log in
>
> if ( "login".equals(action) ) {
>
> username = request.getParameter("username");
>
> password = request.getParameter("password");
>
>
>
> //log in the user
>
> cmso.loginWebUser(username, password);
>
> //out.println(cms.link(requestedResource));
>
> response.sendRedirect(cms.link("/test2"));
>
>
>
> } else if ( "logout".equals(action) ) {
>
> request.getSession().invalidate();
>
> cmso.loginUser("Guest","");
>
> response.sendRedirect(cms.link("/test2"));
>
> } else if (cms.user("name") != null && !"".equals(cms.user("name")) &&
> !"guest".equals(cms.user("name").toLowerCase())) {
>
> %>
>
> <div class="login_element">
>
> <form method="post">
>
> Logged in as: <b><%= cms.user("name") %></b><br/>
>
> <input type=hidden name=action value="logout"><input type=submit
> value="Logout">
>
> </form>
>
> </div>
>
> <%
>
> } else {
>
> %>
>
> <div class="login_element">
>
> <form method="post">
>
> <input name="username" size="15" value="<%=username!=null?username:""
> %>"><br/>
>
> <input name="password" size="15" type="password"><br/>
>
> <input type="submit" value="Login"></td><td><input type="hidden"
> name="action" value="login"><br/>
>
> </form>
>
> </div>
>
> <% } %>
>
> </code>
>
>
>
> I feel that this is a problem with caching, but should I be setting
> something different in the page properties, or in the code?
>
>
>
> **scratches head** :)
>
>
>
> Jon
>
>
>
> ------------------------------------------------------------------------
>
> *From:* Jon Mayes
> *Sent:* 04 January 2006 17:02
> *To:* The OpenCms mailing list
> *Subject:* [opencms-dev] Disappearing nav links...[Scanned]
>
>
>
> Hi guys,
>
>
>
> I’m using the webuser function to authenticate users for certain areas
> of an intranet. I have an interesting problem whereby sometimes after
> logging a webuser in, the links that are not shown to unauthenticated
> users sometimes disappear when browsing through pages after logging in.
> Presumably this is due to a previously cached version of the page being
> used, but do you think this is an issue with the browser or is there
> some caching setting that I should change within opencms to prevent this
> from happening?
>
>
>
> Thanks,
>
>
>
> Jon
>
>
>
> Jon Mayes
>
> Marketing & Business Systems
>
> Pegasus Retirement Homes plc
>
> Tel:
>
> Fax:
>
> Email: jon.mayes at pegasus-homes.co.uk
>
>
>
> For more information on Pegasus please visit our web site at
> www.pegasus-homes.co.uk <http://www.pegasus-homes.co.uk/>
>
>
>
> Privileged/Confidential information may be contained in this message.
> If you are not the addressee indicated in this message (or responsible
> for delivery of the message to such person), you may not copy or deliver
> this message to anyone. In such case, you should destroy this message
> and kindly notify the sender by reply email. Please advise immediately
> if you or your employer does not consent to Internet email for messages
> of this kind. Opinions, conclusions and other information in this
> message that do not relate to the official business of my firm shall be
> understood as neither given nor endorsed by it.
>
>
> Jon Mayes
> Marketing & Business Systems
> Pegasus Retirement Homes plc
> Tel:
> Fax:
> Email: jon.mayes at pegasus-homes.co.uk
>
>
> For more information on Pegasus please visit our web site at
> www.pegasus-homes.co.uk <http://www.pegasus-homes.co.uk/>
>
>
> Privileged/Confidential information may be contained in this message.
> If you are not the addressee indicated in this message (or responsible
> for delivery of the message to such person), you may not copy or deliver
> this message to anyone. In such case, you should destroy this message
> and kindly notify the sender by reply email. Please advise immediately
> if you or your employer does not consent to Internet email for messages
> of this kind. Opinions, conclusions and other information in this
> message that do not relate to the official business of my firm shall be
> understood as neither given nor endorsed by it.
>
>
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
--
Claus Priisholm, CodeDroids ApS
Phone: +45 48 22 46 46
cpr (you know what) codedroids.com - http://www.codedroids.com
cpr (you know what) interlet.dk - http://www.interlet.dk
--
Javadocs and other OpenCms stuff:
http://www.codedroids.com/community/opencms
More information about the opencms-dev
mailing list