MyFaces Trinidad
  1. MyFaces Trinidad
  2. TRINIDAD-1355

tr:form defaultCommand won't work with empty value

    Details

      Description

      The problem is tr:form's defaultCommand attribute throws an exception if it's
      left empty.

      And this is a problem at least for my case where I try to make a Facelets template with a parameterized
      defaultCommand attribute. Whenever I was to use the template, I would have to put something into
      the defaultCommand parameter even if I didn't need defaultCommand for that particular instance.
      Basically I must give it a bogus value to make it work (see "this_is_bogus" below).

      I'd like to have it work without explicit ui:param.

      I encountered it with Trinidad 1.0.8 and didn't try other versions.

      Thanks!

      THE EXCEPTION:

      java.lang.IllegalArgumentException
      at org.apache.myfaces.trinidad.component.UIXComponentBase.findComponent(UIXComponentBase.java:432)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormRenderer.getFullOnkeypress(FormRenderer.java:964)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormRenderer.encodeBegin(FormRenderer.java:172)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeBegin(CoreRenderer.java:200)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeBegin(UIXComponentBase.java:678)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:288)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:321)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:64)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:138)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:119)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:78)
      at org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:335)
      at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.DocumentRenderer.encodeAll(DocumentRenderer.java:80)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:224)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:711)
      at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:252)
      at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:594)
      at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:182)
      at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:250)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:207)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:161)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
      at java.lang.Thread.run(Thread.java:595)

      TEMPLATE:

      <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:trh="http://myfaces.apache.org/trinidad/html" xmlns:tr="http://myfaces.apache.org/trinidad"
      xmlns:ui="http://java.sun.com/jsf/facelets">

      <ui:composition>
      <f:view locale="#

      {smth}

      ">
      <tr:document title="#

      {pTitle}

      ">
      <tr:form defaultCommand="#

      {pDefaultCommand}

      ">
      ...
      </tr:form>
      </tr:document>
      </f:view>
      </ui:composition>
      </jsp:root>

      USE INSTANCE:

      <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:trh="http://myfaces.apache.org/trinidad/html" xmlns:tr="http://myfaces.apache.org/trinidad"
      xmlns:ui="http://java.sun.com/jsf/facelets">

      <ui:composition>
      <ui:decorate>
      <ui:param name="pTitle" value="Test page" />
      <ui:param name="pDefaultCommand" value="this_is_bogus" />
      </ui:decorate>
      </ui:composition>
      </jsp:root>

        Activity

          People

          • Assignee:
            Matthias Weßendorf
            Reporter:
            Caius Gran
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development