h:commandelink操作未执行

时间:2019-12-25 21:18:05

标签: jsf jsf-2

当我单击注销时,我想在导航栏中使用注销,没有任何更改,我不知道为什么

<h:panelGroup layout="block" class="col-12 col-md-10 d-none d-xl-block">
        <nav class="site-navigation position-relative text-right" role="navigation">

<ul class="site-menu js-clone-nav mr-auto d-none d-lg-block">

<li class="active"><a href="index.html"><span>Home</span></a></li>

<li><a href="listings.html"><span>Listings</span></a></li>

<li><a href="about.html"><span>About</span></a></li>

<li><a href="blog.html"><span>Blog</span></a></li>

<li><h:commandLink action="#{loginBean.logout}" value="logout"></h:commandLink>></li>
          </ul>
        </nav>
      </h:panelGroup>

我的LoginBean.java

public String logout() {
        HttpSession session = SessionUtils.getSession();
        session.invalidate();
        System.out.println("sign");
        return "signup";
    }

0 个答案:

没有答案