-1

Eclipse IDE で jsf ベースの Web アプリケーションを開発しています。ログインおよびログアウト操作に関していくつかの問題に直面しています。AS は Weblogic です。アプリケーションに正常にログインおよびログアウトできますが、次のコードはセッションを破棄していません ...:

私のログアウト機能

public String logout() throws IOException {
    FacesContext context = FacesContenter code hereext.getCurrentInstance();
    ExternalContext ec = context.getExternalContext();
    final HttpServletRequest request = (HttpServletRequest) ec.getRequest();
    request.getSession(true).invalidate();
    return ("logout");
}

Faces-Config.xml

<navigation-rule>
    <from-view-id>/home.xhtml</from-view-id>
    <navigation-case>
        <from-outcome>logout</from-outcome>
        <to-view-id>/login.xhtml</to-view-id>
        <redirect />
    </navigation-case>
</navigation-rule>

ロギングのホームページ

<body>
<h:form id="Form">
        Hello<span style="color: ORANGE">
            #{profileController.profile.name}</span>


    <h:commandLink value="sign out" action="#{profileController.logout}" />
</h:form>

Web.xml

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
    <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
    <param-value>true</param-value>
</context-param>
4

1 に答える 1

1

表示されるページは、ブラウザのキャッシュからのものである可能性が最も高いです。特定のページまたはすべてのページのキャッシュを無効にすることができます。詳細については、同様の質問に対するこの回答を参照してください。

于 2012-04-30T06:33:37.483 に答える