2 Replies Latest reply on Aug 11, 2007 5:43 AM by asookazian

    using <s:div rendered="..."> instead of <s:hasRole>

    asookazian

      JBoss 4.0.5
      SEAM 1.2

      is it possible to call a method on a SLSB as follows?:

      <!-- in place of <s:hasRole> restriction -->
      <s:div rendered="#{authenticator.display}">
      <s:button view="/CustomersEdit.xhtml"
      id="edit"
      value="Edit"/>
      </s:div>

      display is a method that returns true or false after evaluating user's role (access level) for that component/page.

      I'm getting the following stack trace:

      javax.faces.el.PropertyNotFoundException: /Customers.xhtml @92,46 rendered="#{authenticator.display}": Bean: org.javassist.tmp.java.lang.Object_$$_javassist_79, property: display

        • 1. Re: using <s:div rendered=

          This is a value binding so el will look for authenticator.getDisplay().

          Regards

          Felix

          • 2. Re: using <s:div rendered=
            asookazian

             

            "fhh" wrote:
            This is a value binding so el will look for authenticator.getDisplay().

            Regards

            Felix


            I tried that as well before posting on this forum and got an exception of similar type. The getDisplay() method was declared as public. I will look at it again.

            BTW, if it's looking for "getDisplay()" then why does the exception reference display as a property? It seems it's looking for a property, not a method...