Anzeige der login-Seite, wenn Benutzer klicken Sie auf zurück-Taste nach dem logout in die struts

Ich mache mein Projekt in struts2 und ich habe die login-Seiten-und logout-Seiten erfolgreich in mein Projekt. Aber wenn sich ein Benutzer Abmelden und er klickt auf die Schaltfläche "zurück" in der browser-Benutzer können die Ansicht der angemeldeten Seite. Wie kann ich das vermeiden?

Hier ist mein html-login-Seite

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<% /* 
    <s:if test="#session.Salesman.username != ''" >
    <script type="text/javascript" >
    top.location.href = "salesmanHome" ;
    </script>
    </s:if>
    <s:else>
     */%>

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-control" content="no-cache">

        <!--++++++DEVELOPED BY WWW.ZOONDIA.IN AND WWW.ZOOCRE8IVE.COM+++++-->
        <title>DrDirect</title>
        <script src="js/scripts.js" type="text/javascript"></script>
        <style type="text/css">@import url("css/styles.css");</style>
                <meta http-equiv="Pragma" content="no-cache"/>
        <meta http-equiv="Cache-Control" content="no-cache"/>
          <meta http-equiv="Expires" content="-1"/>

    </head>

    <body>

        <div class="drDirectHomeWrapper">


            <div id="wrapper" class="drSalesBottomSection innerBotSec">
                <div class="drLoginWrapper overview">
                    <div class="drLoginCont">
                        <div class="drLoginHolder">
                            <img src="images/drHomeLogo.png" width="203" height="41" alt="" />

                            <form action="salesManLogin" method="post">
                                <div class="drLoginField">
                                    <s:if test="hasActionErrors()">
                                        <div class="loginErrorHolder">
                                        <s:actionerror />
                                        </div>
                                    </s:if>  
                                    <input type="hidden" name="urlPath" value="<%=request.getServletPath()%>" />


                                    <div class="drLoginNameHolder queryInput">
                                        <label for="userName">User Name</label>

                                        <%--<s:textfield id="userName"  theme="simple" name="userName"/>--%>
                                        <input type="text" id="userName" name="userName" autocomplete="off"/>
                                    </div>

                                    <div class="drLoginNameHolder queryInput">
                                        <label for="password">Password</label>
                                        <%-- <s:password theme="simple" name="password" id="password"/> --%>
                                        <input type="password" name="password" id="password" autocomplete="off"/>
                                    </div> 



                                    <!-- <input type="submit" class="btnHomeLogIn" value="Login"  /> -->
                                    <button type="submit" class="btnHomeLogIn" >Login</button>

                                    <div class="clear"></div>
                                    <p class="homeLoginPassword">
                                        <a href="gotoForgotPassword.action">Lost Your Password?</a>
                                    </p>
                                </div>
                            </form> 

                        </div>
                    </div>        
                </div>
            </div>
        </div>

    </body>

</html>

und hier ist mein login-Seite Erfolg

<%@taglib prefix="s" uri="/struts-tags" %>
<s:include value="/WEB-INF/salesMan/salesManheader.jsp"/>
<%@page import= "com.myDrDirect.common.MyBase64"%>  
  <div id="container">
        <!--Header-->
        <div id="pageHeader">
             <s:a action="gotosalesManLogout" >Logout</s:a>
            <a href="/" title="DrDirect"><img src="images/pageLogo.png" width="166" height="36" alt="DrDirect" /></a>
        </div>
<s:include value="/WEB-INF/salesMan/salesManLeftMenu.jsp" />
                <!--Right Col-->
                 <%
                                Integer docid = null;
                                String did = null;
                                try {

                                    //docid =0;

                                    did = "0";

                                    MyBase64 Base64 = new MyBase64();
                                    byte[] bytedocid = did.getBytes();
                                    did = Base64.encode(bytedocid);
                                } catch (Exception e) {
                                    e.printStackTrace();
                                }

                            %>
               <%-- <div id="rightCol" class="tablecell3">
                    <!--<iframe src="text.html" height="100%" width="100%" frameborder="0" scrolling="no" allowtransparency="yes"></iframe>-->
                        <div class="drHomeSignUpWrapper">
                            <div class="drHomeSignUpCont">
                                <div class="drHomeSignUpHolder">
                                    <img src="images/drHomeLogo.png" width="203" height="41" alt="" />
                                    <a class="btnDrSignUp" title="Presentation">Presentation</a>
                                    <a href="gotosalesManDoctorhome" id="template" class="btnDrSignUp" title="Templates">Templates</a>
                                    <s:form action="" method="post" name="signUpformDoctor" >
                                    <s:hidden name="ID" value="" id="doctorID"/>
                                    <a href="javascript:void(0);" onclick="redirectpagesignUpformDoctor('<%=did%>');" class="btnDrSignUp" title="Sign Up Doctor">Sign Up Doctor</a>
                                    </s:form>
                                </div>
                            </div>        
                        </div>
                </div>--%>
                <!--End Right Col-->
                  <div id="rightCol" class="tablecell3">
                    <!--<iframe src="text.html" height="100%" width="100%" frameborder="0" scrolling="no" allowtransparency="yes"></iframe>-->
                    <div class="rightWrapper removeClass">
                        <iframe src="salesManhomePage" height="100%" width="100%" id="frameCont" frameborder="0" scrolling="no" name="iframeCenter" allowtransparency="yes"></iframe>
                       <!-- <div class="bgLeftShadow removeClass"></div>-->
                        <div class="bgRightShadow removeClass"></div>
                    </div>
                    <div class="bgRightWrapBot removeClass"><div class="bgBotRight"><div></div></div></div>
                </div>

        <%--<s:include value="/WEB-INF/salesMan/salesmanDoctorsList.jsp" />
        <s:include value="/WEB-INF/salesMan/salesmanIframe.jsp" />--%>




          <s:include value="/WEB-INF/salesMan/salesManFooter.jsp" />

und meine salesManHeader.jsp ist

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"/>
        <!--++++++DEVELOPED BY WWW.ZOONDIA.IN AND WWW.ZOOCRE8IVE.COM+++++-->
        <title>DrDirect - Template</title>
        <script src="js/scripts.js" type="text/javascript"></script>
        <style type="text/css">@import url("css/styles.css");</style>
        <script type="text/javascript">contactScroll="yes";</script>
           <meta http-equiv="Pragma" content="no-cache"/>
        <meta http-equiv="Cache-Control" content="no-cache"/>
          <meta http-equiv="Expires" content="-1"/>
        </head>

    <body style="min-width: 1024px;">

Bitte überprüfen. Ist "Seite einschließen" bewirkt, dass ein problem hier.

Der Inhalt ist wahrscheinlich nur zwischengespeichert. Wenn der Benutzer auf die zurück-Taste und ist wieder in die Website, können Sie wirklich navigieren angemeldet in Aussicht? Vorausgesetzt, Sie haben zerstört, die Sitzung auf Abmelden... Sie kann wahrscheinlich gar nicht tatsächlich sehen alle neuen Inhalte oder tatsächlich durchsuchen Sie die Website, wenn Sie versuchen. Durch klicken auf einen link auf der Website, melden Sie sich.
Du könntest einen javascript check auf jeder Seite, die überprüft, um zu sehen, ob es eine eigentliche Sitzung und leitet Sie, wenn Sie hier nicht ist.

InformationsquelleAutor user359187 | 2012-02-17

Schreibe einen Kommentar