I guess this is generally useful:
@Name("cachedValue")
| @Install(false)
| public class CachedValue {
|
| private ValueBinding value; //Use ValueExpression in Seam 1.3
| private Object cachedValue;
|
| public void setValue(ValueBinding value) { this.value = value; }
|
| public ValueBinding getValue() { return value; }
|
| @Unwrap public Object get() {
| if (cachedValue==null) {
| cachedValue = getValue().getValue();
| }
| return cachedValue;
| }
|
| }
Declare a cached value like this:
<component name="hasPermission" class="CachedValue"
scope="session">
| <property name="value">#{s:hasPermission('enterprise',
'edit', null)}</property>
| </component>
(You can similarly declare any other cached values, and their scopes.)
And use it like #{hasPermission}.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049543#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...