invalidate a session from EL
How can I invalidate a session using EL?开发者_开发知识库
You could do that using JBoss EL. This EL implementation has the capability to invoke methods directly by methodname()
. Put jboss-el.jar
in /WEB-INF/lib
and add the following to the web.xml
, assuming you're using Mojarra:
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>
This way JSF will use this EL implementation to evaluate expressions.
Then you can do in your JSF page:
#{session.invalidate()}
Needless to say that it's not the best place/practice to do this.
精彩评论