2 Replies Latest reply on Mar 14, 2007 4:21 AM by pappy

    failure to resolve method when used in tag files

    pappy Newbie

      Hi,

      I'm trying to use ajax4jsf from a tag file. When I issue a click on a link whose action is a method, the server logs the error "Target Unreachable, identifier 'value' resolved to null" causing "internal server error" message box on the browser.

      I'm using glassfish-9.0 (b48) with JSF-1.2_03, but I don't think it is a JSF related issue, normal JSF commands work well from tag.

      I'm digging into this for several days and cannot figure what is hapenning...

      Here is the tag I'm using:

      <%@ tag display-name="t" isELIgnored="false" body-content="empty"%>
      
      <%@ attribute name="value" required="true" deferredValue="true" deferredValueType="samples.Bean"%>
      
      <%@ taglib prefix="a" uri="https://ajax4jsf.dev.java.net/ajax"%>
      <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
      <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
      <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
      
      <f:subview id="t">
       <h:panelGrid id="grid" columns="8" border="1" columnClasses="display">
       <h:outputText value="#{value.value}" />
       <h:outputText value="#{value.editable ? 'T' : 'F'}" />
       <h:commandButton value="TE" action="#{value.toggleEdit}" />
       <a:commandLink value="FF" action="#{value.toggleEdit}" reRender="grid" ajaxSingle="false" immediate="false" />
       <a:commandLink value="FT" action="#{value.toggleEdit}" reRender="grid" ajaxSingle="false" immediate="true" />
       <a:commandLink value="TF" action="#{value.toggleEdit}" reRender="grid" ajaxSingle="true" immediate="false" />
       <a:commandLink value="TT" action="#{value.toggleEdit}" reRender="grid" ajaxSingle="true" immediate="true" />
       </h:panelGrid>
      </f:subview>
      


      Here is the tag invocation:
       <a:form>
       <q:t value="#{b1}"/>
       <q:t value="#{b2}"/>
       </a:form>
      


      ... and here is the bean

      package samples;
      
      import java.util.Formatter;
      import java.util.logging.Logger;
      
      @SuppressWarnings( "nls" )
      public class Bean
      {
       private final String id = IdGen.next();
      
       private boolean editable;
      
       private String value = "this is my value...";
      
       public Bean()
       {
       }
      
       public Bean( String value )
       {
       setValue( value );
       }
      
       static Bean valueOf( String value )
       {
       return new Bean( value );
       }
      
       public String getId()
       {
       return id;
       }
      
       public boolean isEditable()
       {
       return editable;
       }
      
       public void setEditable( boolean editable )
       {
       this.editable = editable;
       }
      
       public String getValue()
       {
       return this.value;
       }
      
       public void setValue( String value )
       {
       this.value = value;
       }
      
       @Override
       public String toString()
       {
       return getId() + ": " + getValue();
       }
      
       public String toggleEdit()
       {
       setEditable( !isEditable() );
      
       return null;
       }
      
      }
      


      Thanks for any help...

      --

      pappy


        • 1. Re: failure to resolve method when used in tag files
          Nick Belaevski Master

          Hello!

          There's the updated Glassfish version available: https://glassfish.dev.java.net/downloads/v1_ur1-b14.html. Can you please try it?

          • 2. Re: failure to resolve method when used in tag files
            pappy Newbie

            Hi,

            Thanx for your answer...

            Actually I tested with the following



            For each of the above is tested with the original JSF, then with JSF-RI-2.1_03 and today with JSF-RI-2.1_04 but got the same result.

            I still suspect is not a JSF related issue since all the JSF actions defined in the file tag work...

            <!-- This works -->
            <h:commandLink value="TE" action="#{value.toggleEdit}" />
            <!-- This doesn't work -->
            <a:commandLink value="FF" action="#{value.toggleEdit}"/>
            


            Doing some debugging I noticed that the parameter
            varMapping
            used for the MethodExpressionImpl instantiation is null when clicked on <a:commandLink/> and not null when clicked on <h:commandLink/>. Having varMapper null, the ELcontext is not able to solve the variable... Maybe this could be a starting point, see below the stacktrace

            If necessary I could provide a link for downloading the whole application - no NDA needed :)

            javax.el.PropertyNotFoundException: Target Unreachable, identifier 'value' resolved to null
             at com.sun.el.parser.AstValue.getTarget(AstValue.java:66)
             at com.sun.el.parser.AstValue.invoke(AstValue.java:147)
             at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
             at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
             at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:96)
             at javax.faces.component.UICommand.broadcast(UICommand.java:383)
             at org.ajax4jsf.framework.ajax.AjaxActionComponent.broadcast(AjaxActionComponent.java:47)
             at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
             at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
             at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
             at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
             at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
             at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
             at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
             at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
             at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
             at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
             at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
             at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
             at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
             at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
             at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
             at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
             at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
             at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
             at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
             at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
             at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
             at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
             at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
             at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
             at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
             at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
             at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
             at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
             at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
            |


            10x

            --

            pappy