tags:

views:

41

answers:

1

How can I invalidate a session using EL?

A: 

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.

BalusC