MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-1562

tomahawk20-1.1.10 for JSF 2 does not work: aliasBean

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.11
    • Component/s: Alias Bean
    • Labels:
      None
    • Environment:
      Windows, tomahawk20-1.1.10, JSF 2.0 (Mojarra 2.0) on JBoss AS 6, Richfaces 3.3.1

      Description

      I tried tomahawk20-1.1.10 with jsf 2.0 (Mojarra 2.0) on JBoss AS 6, and got the following exception. The bean is alias, and it works for JSF 1.2.

      <t:aliasBean alias="#

      {bean}

      " value="#

      {fooBean}

      ">
      <f:subview id="foo">
      <jsp:include page="/include/foo.jsp" />
      </f:subview>
      </t:aliasBean>

      org.apache.jasper.el.JspPropertyNotFoundException: /include/foo.jsp(47,2) '#

      {bean.result}

      ' The class 'java.lang.String' does not have the property 'result'
      .
      at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:104) [:6.0.0.Final]
      at org.apache.myfaces.custom.aliasbean.Alias.computeEvaluatedExpression(Alias.java:112) [:1.1.10]
      at org.apache.myfaces.custom.aliasbean.Alias.make(Alias.java:136) [:1.1.10]
      at org.apache.myfaces.custom.aliasbean.AliasBean.makeAlias(AliasBean.java:349) [:1.1.10]
      at org.apache.myfaces.custom.aliasbean.AliasBean.makeAlias(AliasBean.java:334) [:1.1.10]
      at org.apache.myfaces.custom.aliasbean.AliasBeanTag.doStartTag(AliasBeanTag.java:52) [:1.1.10]

        Activity

        Hide
        Dave added a comment -

        Same error for using Mojarra 1.2 with tomahawk12-1.1.10

        Show
        Dave added a comment - Same error for using Mojarra 1.2 with tomahawk12-1.1.10
        Hide
        Leonardo Uribe added a comment -

        t:aliasBean in tomahawk12 or earlier required a hack in myfaces core to work, so it will not work with Mojarra 1.2

        In tomahawk20, the way how binding assigment is done was normalized using system events (by JSF 2.0), so now t:aliasBean works with Mojarra too, but it is probably that change the one causing problems here.

        Show
        Leonardo Uribe added a comment - t:aliasBean in tomahawk12 or earlier required a hack in myfaces core to work, so it will not work with Mojarra 1.2 In tomahawk20, the way how binding assigment is done was normalized using system events (by JSF 2.0), so now t:aliasBean works with Mojarra too, but it is probably that change the one causing problems here.
        Hide
        Dave added a comment -

        I am wondering if there is a workaround for t:aliasBean, so that i can move forward.

        Show
        Dave added a comment - I am wondering if there is a workaround for t:aliasBean, so that i can move forward.
        Hide
        Leonardo Uribe added a comment -

        I did a full review of the component to find the problem and I was able to reproduce it. I found that the template used to generate tomahawk jsp tld file was changed in JSF 2.0. The problem was caused by this line on Alias bean

        @JSFProperty
        public String getValue()

        It is true the method returns String but it is expected the value expression returns Object. The solution is do this:

        @JSFProperty(deferredValueType="java.lang.Object")
        public String getValue()

        I did some other small changes to take into consideration JSP usage (cache facesContext again, add invokeOnComponent code.

        Show
        Leonardo Uribe added a comment - I did a full review of the component to find the problem and I was able to reproduce it. I found that the template used to generate tomahawk jsp tld file was changed in JSF 2.0. The problem was caused by this line on Alias bean @JSFProperty public String getValue() It is true the method returns String but it is expected the value expression returns Object. The solution is do this: @JSFProperty(deferredValueType="java.lang.Object") public String getValue() I did some other small changes to take into consideration JSP usage (cache facesContext again, add invokeOnComponent code.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Dave
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development