Author: ppitonak(a)redhat.com
Date: 2011-04-07 11:37:35 -0400 (Thu, 07 Apr 2011)
New Revision: 22390
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
https://issues.jboss.org/browse/RFPL-1125
invalidating of session in MyFaces fixed
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-04-07
12:42:38 UTC (rev 22389)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-04-07
15:37:35 UTC (rev 22390)
@@ -34,6 +34,7 @@
import javax.faces.FacesException;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.AjaxBehaviorEvent;
@@ -337,15 +338,17 @@
}
public String invalidateSession() {
- Object session =
FacesContext.getCurrentInstance().getExternalContext().getSession(true);
+ ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
+ Object session = ec.getSession(false);
+
if (session == null) {
return "/index";
}
if (session instanceof HttpSession) {
((HttpSession) session).invalidate();
- return FacesContext.getCurrentInstance().getViewRoot().getViewId() +
"?faces-redirect=true";
+ return FacesContext.getCurrentInstance().getViewRoot().getViewId();
}
throw new IllegalStateException();
@@ -408,7 +411,7 @@
*/
public void itemChangeListener(ItemChangeEvent event) {
logToPage("* item changed: " + (event.getOldItem() == null ? null :
event.getOldItem().getId()) + " -> "
- + event.getNewItem().getId());
+ + event.getNewItem().getId());
}
/**