-1

Hi i can define functions like this for el:

    <function>
        <function-name>areAllGranted</function-name>
        <function-class>org.springframework.faces.security.FaceletsAuthorizeTagUtils</function-class>
        <function-signature>boolean areAllGranted(java.lang.String)</function-signature>
    </function>
</facelet-taglib>

but what can i do if i want to use a spring bean with initalised autowired-fields, instead of a plain new instance of an class?

wutzebaer
  • 14,365
  • 19
  • 99
  • 170
  • An EL function does by the way not use a "plain new instance of an class". It's a static method. – BalusC May 16 '12 at 13:37

1 Answers1

2

If your're using a Servlet 3.0 container which supports EL 2.2 (Tomcat 7, Glassfish 3, etc), just do it.

<h:someComponent rendered="#{bean.areAllGranted('someString')}">

If your're using an old Servlet 2.5 container which doesn't support it, then install JBoss EL so that you can use the new EL 2.2 syntax. This is answered in detail here: Invoking methods with parameters by EL in JSF 1.2

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555