webtier@glassfish.java.net

[webtier] Re: Correct way to terminate a session / JSF 2 ?

From: Ed Burns <edward.burns_at_oracle.com>
Date: Thu, 15 Apr 2010 11:12:56 -0700

>>>>> On Sat, 03 Apr 2010 01:30:46 -0700 (PDT), webtier_at_javadesktop.org said:

JK> You can try to redirect manually, like this:
JK> public String testAction()
JK> {
JK> ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
JK> ec.invalidateSession();
JK> ec.redirect("login.xhtml"); // Or whatever servlet mapping you use
JK> // redirect() invokes FacesContext.responseComplete() for you

Also, in JavaEE 6, HttpServletRequest has a logout() method.

Ed

-- 
| edward.burns_at_oracle.com  | office: 408 884 9519 OR x31640
| homepage:                | http://ridingthecrest.com/