You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ingo Düppe <ma...@dueppe.com> on 2007/02/07 11:38:31 UTC

Accessing constants in EL expressions

Hi,

how can I access a constant integer value within an el-statement.

I like to do something like:
<s:acl domainObject="#{faculty}" hasPermission="#{ACL.GRANT + ACL.UPDATE}">
   ...
</s:acl>

And ACL is defined as:

public class ACL ... {
   public static final Integer GRANT = 1;
   public static final Integer CREATE = 2;
   public static final Integer UPDATE = 4;
   ...
}

Any suggestions would be wonderful :-)

Regards
Ingo



Re: Is there a tag that can output text ith parameters (format string) with parameters as attributes?

Posted by David Delbecq <de...@oma.be>.
<h:outputFormat value=".....">
  <f:param value="..."/>
  <f:param value="..."/>
  <f:param value="..."/>
</h:outputFormat> 


En l'instant précis du 02/07/07 16:25, SOSELLA@austin.rr.com s'exprimait
en ces termes:
> Is there a tag (i.e., outputText) that you can specify a format string
> and then pass parameters as attribute values?  That is, a tag something
> like:
>
> <t:outputText value="#{bundle.fmt_str_key}" param0="#{bean.name}" />
>
> and in the message bundle something like this:
>
> fmt_str_key=Hello: {0}
>
> Thanks
>   


Is there a tag that can output text ith parameters (format string) with parameters as attributes?

Posted by SO...@austin.rr.com.
Is there a tag (i.e., outputText) that you can specify a format string
and then pass parameters as attribute values?  That is, a tag something
like:

<t:outputText value="#{bundle.fmt_str_key}" param0="#{bean.name}" />

and in the message bundle something like this:

fmt_str_key=Hello: {0}

Thanks

Re: Accessing constants in EL expressions

Posted by Jeff Bischoff <jb...@klkurz.com>.
Known Workaround: Create a getter method for the Constant.

Ingo Düppe wrote:
> Hi,
> 
> how can I access a constant integer value within an el-statement.
> 
> I like to do something like:
> <s:acl domainObject="#{faculty}" hasPermission="#{ACL.GRANT + ACL.UPDATE}">
>   ...
> </s:acl>
> 
> And ACL is defined as:
> 
> public class ACL ... {
>   public static final Integer GRANT = 1;
>   public static final Integer CREATE = 2;
>   public static final Integer UPDATE = 4;
>   ...
> }
> 
> Any suggestions would be wonderful :-)
> 
> Regards
> Ingo
> 
> 
> 
> 
>