FAQ
I have the following:

<h:commandLink action="userByUsername"
onclick="open_alert();">
<h:outputText value="#{user.username}"/>
</h:commandLink>


But I need the command to be the action to be something like
userByUsername?username=#{user.username} to fire an event for my navigation
rule "userByUsername" and sending a parameter of the username for each row
as #{user.username}

Search Discussions

  • Jeff Bischoff at Feb 22, 2007 at 9:23 pm
    I recommend t:updateActionListener. See [1]

    [1] http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters

    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink action="userByUsername"
    onclick="open_alert();">
    <h:outputText value="#{user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something like
    userByUsername?username=#{user.username} to fire an event for my navigation
    rule "userByUsername" and sending a parameter of the username for each row
    as #{user.username}
  • Mick Knutson at Feb 22, 2007 at 11:43 pm
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at com.sun.facelets.compiler.TagLibraryConfig.create(
    TagLibraryConfig.java:396)
    at com.sun.facelets.FaceletViewHandler.initializeCompiler(
    FaceletViewHandler.java:281)
    at com.sun.facelets.FaceletViewHandler.initialize(
    FaceletViewHandler.java:184)
    at com.sun.facelets.FaceletViewHandler.renderView(
    FaceletViewHandler.java:421)
    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:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:264)
    at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(
    FilterSecurityInterceptor.java:107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(
    FilterSecurityInterceptor.java:72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:274)
    at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java:110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(
    SecurityContextHolderAwareRequestFilter.java:81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(
    HttpSessionContextIntegrationFilter.java:229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:274)
    at org.acegisecurity.util.FilterChainProxy.doFilter(
    FilterChainProxy.java:148)
    at org.acegisecurity.util.FilterToBeanProxy.doFilter(
    FilterToBeanProxy.java:98)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(
    ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(
    ApplicationDispatcher.java:463)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(
    ApplicationDispatcher.java:398)
    at org.apache.catalina.core.ApplicationDispatcher.forward(
    ApplicationDispatcher.java:301)
    at org.apache.jasper.runtime.PageContextImpl.doForward(
    PageContextImpl.java:703)
    at org.apache.jasper.runtime.PageContextImpl.forward(
    PageContextImpl.java:670)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java
    :97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(
    JspServletWrapper.java:332)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(
    JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
    ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(
    StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(
    StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
    SecurityAssociationValve.java:175)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(
    JaccContextValve.java:74)
    at org.apache.catalina.core.StandardHostValve.invoke(
    StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(
    ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(
    StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(
    CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(
    Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
    PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(
    MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException: Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393,107]
    (
    TagLibraryConfig.java:258)
    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
    Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown
    Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
    Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
    Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at com.sun.facelets.compiler.TagLibraryConfig.create(
    TagLibraryConfig.java:393)
    ... 53 more
    Caused by: java.lang.Exception:
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener must be
    an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass(
    TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(
    TagLibraryConfig.java:205)
    ... 68 more


    On 2/22/07, Jeff Bischoff wrote:

    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters

    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink action="userByUsername"
    onclick="open_alert();">
    <h:outputText value="#{user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something like
    userByUsername?username=#{user.username} to fire an event for my
    navigation
    rule "userByUsername" and sending a parameter of the username for each row
    as #{user.username}

    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 23, 2007 at 1:22 am
    You have to include the tag handler java class as well.

    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>

    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>

    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler(FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    (ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    (PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException: Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
    Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception:
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something like
    userByUsername?username=#{user.username} to fire an event for my
    navigation
    rule "userByUsername" and sending a parameter of the username for each
    row
    as #{user.username}


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mick Knutson at Feb 23, 2007 at 7:58 pm
    I got the form to come up, but when I click the username link, I get this
    error:


    javax.servlet.ServletException: Error calling action method of
    component with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)



    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{userBackingBean.users}"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"
    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    >
    <h:column>
    <f:facet name="header">
    <h:outputText value="#{messages['label.username']}"/>
    </f:facet>
    <t:commandLink action="#{userBackingBean.prepareForEdit}">
    <h:outputText value="#{user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username}" value="#{user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>

    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>




    On 2/22/07, Mike Kienenberger wrote:

    You have to include the tag handler java class as well.


    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>

    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>

    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler(
    FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java :184)
    at
    com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java :421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(
    FilterSecurityInterceptor.java:72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java:110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java:81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(
    HttpSessionContextIntegrationFilter.java:229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    (ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(
    ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward(
    ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward(
    ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java :703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    (PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service(
    JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
    ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(
    StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(
    StandardContextValve.java:178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
    SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke(
    JaccContextValve.java:74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(
    StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java :148)
    at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(
    MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException: Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(
    TagLibraryConfig.java:258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
    Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception:
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(
    TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something like
    userByUsername?username=#{user.username} to fire an event for my
    navigation
    rule "userByUsername" and sending a parameter of the username for
    each


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 23, 2007 at 8:19 pm
    Add an id field to make sure it's an error for the t:commandLink you posted.

    is there more stack trace available? I'm guessing it's a problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText value="#{user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username link, I get this
    error:


    javax.servlet.ServletException: Error calling action method of component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java:154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java:81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)

    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)



    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users}"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText value="#{user.username}"/>
    <t:updateActionListener property="#{userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>

    <from-view-id>/views/admin/users.xhtml</from-view-id>

    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>

    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>





    On 2/22/07, Mike Kienenberger wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>

    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler(FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java:81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    (ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    (PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    (JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException: Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse(Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception:
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something like
    userByUsername?username=#{user.username} to fire an event for my
    navigation
    rule "userByUsername" and sending a parameter of the username for
    each


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mick Knutson at Feb 23, 2007 at 9:40 pm
    The issue was in my method signature. I needed to have no parameters in the
    action.


    With that completed, there seems to be another issue now.
    Caused by: javax.faces.el.EvaluationException: Bean:
    com.baselogic.tro.user.User, property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class: javax.faces.component.html.HtmlInputText method
    parameter class: java.lang.String
    at org.apache.myfaces.el.PropertyResolverImpl.setProperty(
    PropertyResolverImpl.java:414)
    at org.apache.myfaces.el.PropertyResolverImpl.setValue(
    PropertyResolverImpl.java:176)
    at com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(
    LegacyELContext.java:201)
    at com.sun.el.parser.AstValue.setValue(AstValue.java:113)
    at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java
    :246)
    at com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at com.sun.facelets.el.LegacyValueBinding.setValue(
    LegacyValueBinding.java:68)
    ... 67 more
    Caused by: java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.myfaces.el.PropertyResolverImpl.setProperty(
    PropertyResolverImpl.java:409)
    ... 73 more



    My #{userBackingBean.user.username} is a String as it should be as this is
    just a POJO

    <h:inputText value="#{userBackingBean.user.username}"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username}"
    >
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;
    }






    On 2/23/07, Mike Kienenberger wrote:

    Add an id field to make sure it's an error for the t:commandLink you
    posted.

    is there more stack trace available? I'm guessing it's a problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText value="#{user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username link, I get this
    error:


    javax.servlet.ServletException: Error calling action method of component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
    ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(
    FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter (
    FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java :274)

    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java:81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter (
    FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter (
    FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users}"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText value="#{user.username}"/>
    <t:updateActionListener property="#{userBackingBean.user.username
    }" value="#{ user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>

    <from-view-id>/views/admin/users.xhtml</from-view-id>

    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>

    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>





    On 2/22/07, Mike Kienenberger wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>

    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler (
    FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java
    :184)
    at
    com.sun.facelets.FaceletViewHandler.renderView (FaceletViewHandler.java
    :421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter (
    ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter (
    FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter (
    FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    (ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(
    ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward (
    ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    (PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    (JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (
    ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
    ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(
    StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
    SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke(
    JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke (
    StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
    :148)
    at
    org.apache.coyote.http11.Http11Processor.process (Http11Processor.java
    :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run (
    MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException: Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393 ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(
    TagLibraryConfig.java:258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something like
    userByUsername?username=#{user.username} to fire an event for my
    navigation
    rule "userByUsername" and sending a parameter of the username
    for


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 23, 2007 at 9:47 pm
    binding="#{userBackingBean.user.username}" is the cause of this error.
    It's attempting to assign the HtmlInputText component to the value of username.

    "binding" is for getting a reference to the component on a page into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no parameters in the
    action.


    With that completed, there seems to be another issue now.
    Caused by: javax.faces.el.EvaluationException: Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText method parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue(PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java:113)
    at
    com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:246)
    at com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by: java.lang.IllegalArgumentException: argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolverImpl.java:409)
    ... 73 more



    My #{userBackingBean.user.username} is a String as it should be as this is
    just a POJO

    <h:inputText value="#{userBackingBean.user.username}"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username}"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the t:commandLink you posted.
    is there more stack trace available? I'm guessing it's a problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username link, I get
    this
    error:


    javax.servlet.ServletException: Error calling action method of component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java:81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users}"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText value="#{user.username}"/>
    <t:updateActionListener property="#{userBackingBean.user.username
    }" value="#{ user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>

    <from-view-id>/views/admin/users.xhtml</from-view-id>

    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>

    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>





    On 2/22/07, Mike Kienenberger wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>

    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    (ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    (PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    (JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException: Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something like
    userByUsername?username=#{user.username} to fire an event for my
    navigation
    rule "userByUsername" and sending a parameter of the username
    for


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mick Knutson at Feb 23, 2007 at 9:56 pm
    Ok, thanks.

    But now, I have a UserBackingBean.user = manager.getUser(user.getUsername
    ());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)




    On 2/23/07, Mike Kienenberger wrote:

    binding="#{userBackingBean.user.username}" is the cause of this error.
    It's attempting to assign the HtmlInputText component to the value of
    username.

    "binding" is for getting a reference to the component on a page into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no parameters in the
    action.


    With that completed, there seems to be another issue now.
    Caused by: javax.faces.el.EvaluationException: Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText method parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue(
    PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(
    LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java:113)
    at
    com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:246)
    at com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java :68)
    ... 67 more
    Caused by: java.lang.IllegalArgumentException: argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(
    NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(
    DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty(
    PropertyResolverImpl.java:409)
    ... 73 more



    My #{userBackingBean.user.username} is a String as it should be as this is
    just a POJO

    <h:inputText value="#{userBackingBean.user.username}"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username}"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the t:commandLink you posted.
    is there more stack trace available? I'm guessing it's a problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username link, I get
    this
    error:


    javax.servlet.ServletException: Error calling action method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
    ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(
    FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java:81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users}"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText value="#{user.username}"/>
    <t:updateActionListener property="#{userBackingBean.user.username
    }" value="#{ user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>

    <from-view-id>/views/admin/users.xhtml</from-view-id>

    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>

    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>





    On 2/22/07, Mike Kienenberger wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>

    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java
    :184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java:107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    (ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(
    ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    (PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    (JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
    ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(
    StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
    SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke(
    JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
    :126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
    :148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException: Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(
    TagLibraryConfig.java:258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something like
    userByUsername?username=#{user.username} to fire an event
    for my
    navigation
    rule "userByUsername" and sending a parameter of the
    username


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 23, 2007 at 10:01 pm
    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An easy
    test is to make it session-scoped temporarily and see if that works.
    If it does, a better fix in my opinion is to either use t:saveState on
    userBackingBean.user (if you don't need to preserve the whole bean) or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of this error.
    It's attempting to assign the HtmlInputText component to the value of username.
    "binding" is for getting a reference to the component on a page into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by: javax.faces.el.EvaluationException: Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java :113)
    at
    com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by: java.lang.IllegalArgumentException: argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{userBackingBean.user.username} is a String as it should be as this
    is
    just a POJO

    <h:inputText value="#{userBackingBean.user.username }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the t:commandLink you posted.
    is there more stack trace available? I'm guessing it's a problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username link, I get
    this
    error:


    javax.servlet.ServletException: Error calling action method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java:81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    ( HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users}"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{user.username}"/>
    <t:updateActionListener property="#{userBackingBean.user.username
    }" value="#{ user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>





    On 2/22/07, Mike Kienenberger wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java:98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    (ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    (PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    (JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException: Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java:258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something like
    userByUsername?username=#{user.username} to fire an event
    for my
    navigation
    rule "userByUsername" and sending a parameter of the
    username


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mick Knutson at Feb 23, 2007 at 10:51 pm
    Because I am using the jsf-acegi in my app, I can't make everything session
    scoped as it gives me these strange errors so I changed them all back to
    request.


    So how should I implement this t:saveState ??? On my userTable.xhtml:

    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???


    On 2/23/07, Mike Kienenberger wrote:

    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An easy
    test is to make it session-scoped temporarily and see if that works.
    If it does, a better fix in my opinion is to either use t:saveState on
    userBackingBean.user (if you don't need to preserve the whole bean) or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of this error.
    It's attempting to assign the HtmlInputText component to the value of username.
    "binding" is for getting a reference to the component on a page into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no parameters
    in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by: javax.faces.el.EvaluationException: Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(
    LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java :113)
    at
    com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java
    :68)
    ... 67 more
    Caused by: java.lang.IllegalArgumentException: argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(
    NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty(
    PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{userBackingBean.user.username} is a String as it should be as
    this
    is
    just a POJO

    <h:inputText value="#{userBackingBean.user.username }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's a problem
    with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username link, I
    get
    this
    error:


    javax.servlet.ServletException: Error calling action method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
    ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(
    FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java:81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    ( HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users}"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{user.username}"/>
    <t:updateActionListener property="#{
    userBackingBean.user.username
    }" value="#{ user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>





    On 2/22/07, Mike Kienenberger wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java
    :184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java:229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java:98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    (ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(
    ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    (PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    (JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(
    StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
    SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
    :126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException: Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(
    TagLibraryConfig.java:258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be something
    like
    userByUsername?username=#{user.username} to fire an
    event


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mick Knutson at Feb 23, 2007 at 11:05 pm
    The only thing I am trying to do is view a list of users. Then be able to
    click the username, pull up that user in an editable form.



    On 2/23/07, Mick Knutson wrote:

    Because I am using the jsf-acegi in my app, I can't make everything
    session scoped as it gives me these strange errors so I changed them all
    back to request.


    So how should I implement this t:saveState ??? On my userTable.xhtml:

    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???


    On 2/23/07, Mike Kienenberger wrote:

    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An easy
    test is to make it session-scoped temporarily and see if that works.
    If it does, a better fix in my opinion is to either use t:saveState on
    userBackingBean.user (if you don't need to preserve the whole bean) or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of this
    error.
    It's attempting to assign the HtmlInputText component to the value
    of
    username.
    "binding" is for getting a reference to the component on a page into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no
    parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by: javax.faces.el.EvaluationException: Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(
    LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java :113)
    at
    com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(
    LegacyValueBinding.java:68)
    ... 67 more
    Caused by: java.lang.IllegalArgumentException: argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(
    NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty(
    PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{userBackingBean.user.username} is a String as it should be
    as this
    is
    just a POJO

    <h:inputText value="#{userBackingBean.user.username }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling action method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter (
    ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter (
    FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    ( HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(
    FilterToBeanProxy.java:98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener property="#{
    userBackingBean.user.username
    }" value="#{ user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>





    On 2/22/07, Mike Kienenberger wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java
    :184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter (
    ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java:98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter (
    ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest (
    ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile( JspServlet.java
    :314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke (
    StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
    SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(
    StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
    Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(
    TagLibraryConfig.java :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be
    something like
    userByUsername?username=#{ user.username} to fire an
    event


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 24, 2007 at 2:58 am
    The following should work.

    <t:saveState id="user" value="#{userBackingBean.user}" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with the
    same id.

    You'll need to be sure that the id is unique (I generally use the page
    name followed by the item to preserve, ie. viewUsersPageSelectedUser.

    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{userBackingBean.users}" />

    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then be able to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make everything
    session scoped as it gives me these strange errors so I changed them all
    back to request.

    So how should I implement this t:saveState ??? On my userTable.xhtml:

    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An easy
    test is to make it session-scoped temporarily and see if that works.
    If it does, a better fix in my opinion is to either use t:saveState on
    userBackingBean.user (if you don't need to preserve the whole bean) or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of this
    error.
    It's attempting to assign the HtmlInputText component to the value
    of
    username.
    "binding" is for getting a reference to the component on a page into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no
    parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by: javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by: java.lang.IllegalArgumentException:
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{userBackingBean.user.username} is a String as it should be
    as this
    is
    just a POJO

    <h:inputText value="#{userBackingBean.user.username }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling action method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    (ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{ user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>





    On 2/22/07, Mike Kienenberger wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    (ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile (
    JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be
    something like
    userByUsername?username=#{ user.username} to fire an
    event


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mick Knutson at Feb 26, 2007 at 9:12 pm
    I am still having issues it seems. I can display the table just fine and
    then when I click the link, I get sent to UserBackingBeanImpl.prepareForEdit()
    then to my edit user form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.java file
    here..

    I really appreciate your help.

    On 2/23/07, Mike Kienenberger wrote:

    The following should work.

    <t:saveState id="user" value="#{userBackingBean.user}" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with the
    same id.

    You'll need to be sure that the id is unique (I generally use the page
    name followed by the item to preserve, ie. viewUsersPageSelectedUser.

    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{userBackingBean.users}"
    />

    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then be able to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make everything
    session scoped as it gives me these strange errors so I changed them all
    back to request.

    So how should I implement this t:saveState ??? On my userTable.xhtml:

    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An easy
    test is to make it session-scoped temporarily and see if that works.
    If it does, a better fix in my opinion is to either use t:saveState
    on
    userBackingBean.user (if you don't need to preserve the whole bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of this
    error.
    It's attempting to assign the HtmlInputText component to the
    value
    of
    username.
    "binding" is for getting a reference to the component on a page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no
    parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by: javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(
    LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java
    :68)
    ... 67 more
    Caused by: java.lang.IllegalArgumentException:
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(
    NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty(
    PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{userBackingBean.user.username} is a String as it should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{userBackingBean.user.username }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    (ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java:264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java:72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java:110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java:148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{ user.username}"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java:281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java
    :184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    (ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java:672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile (
    JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
    SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
    :126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(
    TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be
    something like
    userByUsername?username=#{ user.username} to fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a parameter of
    the


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 27, 2007 at 3:40 am
    Mick,

    I'm taking a look at this. I'll let you know what I figure out.
    On 2/26/07, Mick Knutson wrote:
    I am still having issues it seems. I can display the table just fine and
    then when I click the link, I get sent to
    UserBackingBeanImpl.prepareForEdit() then to my edit user
    form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.java file
    here..

    I really appreciate your help.


    On 2/23/07, Mike Kienenberger wrote:
    The following should work.

    <t:saveState id="user" value="#{ userBackingBean.user}" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with the
    same id.

    You'll need to be sure that the id is unique (I generally use the page
    name followed by the item to preserve, ie. viewUsersPageSelectedUser.

    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{ userBackingBean.users}"
    />
    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then be able
    to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make everything
    session scoped as it gives me these strange errors so I changed them all
    back to request.

    So how should I implement this t:saveState ??? On my userTable.xhtml:

    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An easy
    test is to make it session-scoped temporarily and see if that works.
    If it does, a better fix in my opinion is to either use t:saveState
    on
    userBackingBean.user (if you don't need to preserve the whole bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of this
    error.
    It's attempting to assign the HtmlInputText component to the
    value
    of
    username.
    "binding" is for getting a reference to the component on a page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no
    parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by:
    javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText
    method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue
    (ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by:
    java.lang.IllegalArgumentException:
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0 (Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{ userBackingBean.user.username} is a String as it should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{ userBackingBean.user.username
    }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    (ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    ( FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java :72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{ user.username }"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java :281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    (ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (
    SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java :672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile (
    JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java :96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be
    something like
    userByUsername?username=#{ user.username} to fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a parameter of
    the


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 27, 2007 at 3:49 am
    Well, one thing I see right off:

    <t:updateActionListener
    property="#{userBackingBean.user.username}"
    value="#{user.username}">

    This is only going to set a username, not a user.
    Furthermore, if user is already null, it may not set anything.

    My guess is that you really want this:

    <t:updateActionListener
    property="#{userBackingBean.user}"
    value="#{user}">

    On 2/26/07, Mike Kienenberger wrote:
    Mick,

    I'm taking a look at this. I'll let you know what I figure out.
    On 2/26/07, Mick Knutson wrote:
    I am still having issues it seems. I can display the table just fine and
    then when I click the link, I get sent to
    UserBackingBeanImpl.prepareForEdit() then to my edit user
    form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.java file
    here..

    I really appreciate your help.


    On 2/23/07, Mike Kienenberger wrote:
    The following should work.

    <t:saveState id="user" value="#{ userBackingBean.user}" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with the
    same id.

    You'll need to be sure that the id is unique (I generally use the page
    name followed by the item to preserve, ie. viewUsersPageSelectedUser.

    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{ userBackingBean.users}"
    />
    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then be able
    to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make everything
    session scoped as it gives me these strange errors so I changed them all
    back to request.

    So how should I implement this t:saveState ??? On my userTable.xhtml:

    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An easy
    test is to make it session-scoped temporarily and see if that works.
    If it does, a better fix in my opinion is to either use t:saveState
    on
    userBackingBean.user (if you don't need to preserve the whole bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of this
    error.
    It's attempting to assign the HtmlInputText component to the
    value
    of
    username.
    "binding" is for getting a reference to the component on a page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no
    parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by:
    javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText
    method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue
    (ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by:
    java.lang.IllegalArgumentException:
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0 (Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{ userBackingBean.user.username} is a String as it should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{ userBackingBean.user.username
    }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    (ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    ( FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java :72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{ user.username }"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java :281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    (ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (
    SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java :672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile (
    JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java :96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more




    On 2/22/07, Jeff Bischoff < jbischoff@klkurz.com>
    wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be
    something like
    userByUsername?username=#{ user.username} to fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a parameter of
    the


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 27, 2007 at 3:52 am
    And

    private User user = new User();

    should just be

    private User user;

    On 2/26/07, Mike Kienenberger wrote:
    Well, one thing I see right off:

    <t:updateActionListener
    property="#{userBackingBean.user.username}"
    value="#{user.username}">

    This is only going to set a username, not a user.
    Furthermore, if user is already null, it may not set anything.

    My guess is that you really want this:

    <t:updateActionListener
    property="#{userBackingBean.user}"
    value="#{user}">

    On 2/26/07, Mike Kienenberger wrote:
    Mick,

    I'm taking a look at this. I'll let you know what I figure out.
    On 2/26/07, Mick Knutson wrote:
    I am still having issues it seems. I can display the table just fine and
    then when I click the link, I get sent to
    UserBackingBeanImpl.prepareForEdit() then to my edit user
    form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.java file
    here..

    I really appreciate your help.


    On 2/23/07, Mike Kienenberger wrote:
    The following should work.

    <t:saveState id="user" value="#{ userBackingBean.user}" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with the
    same id.

    You'll need to be sure that the id is unique (I generally use the page
    name followed by the item to preserve, ie. viewUsersPageSelectedUser.

    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{ userBackingBean.users}"
    />
    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then be able
    to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make everything
    session scoped as it gives me these strange errors so I changed them all
    back to request.

    So how should I implement this t:saveState ??? On my userTable.xhtml:

    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An easy
    test is to make it session-scoped temporarily and see if that works.
    If it does, a better fix in my opinion is to either use t:saveState
    on
    userBackingBean.user (if you don't need to preserve the whole bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of this
    error.
    It's attempting to assign the HtmlInputText component to the
    value
    of
    username.
    "binding" is for getting a reference to the component on a page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no
    parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by:
    javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText
    method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue
    (ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by:
    java.lang.IllegalArgumentException:
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0 (Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{ userBackingBean.user.username} is a String as it should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{ userBackingBean.user.username
    }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    (ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    ( FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java :72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{ user.username }"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java :281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    (ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (
    SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java :672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile (
    JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java :96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more




    On 2/22/07, Jeff Bischoff < jbischoff@klkurz.com>
    wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be
    something like
    userByUsername?username=#{ user.username} to fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a parameter of
    the


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 27, 2007 at 5:05 am
    Not sure why this bounced as spam. Maybe it was the zip attachment.
    Trying the pieces as individuals.

    ---------- Forwarded message ----------
    From: Mike Kienenberger <mkienenb@gmail.com>
    Date: Feb 26, 2007 11:56 PM
    Subject: Re: t:datatable with commandLink and parameter
    To: MyFaces Discussion <users@myfaces.apache.org>
    Cc: mickknutson@gmail.com


    Here's an example showing what you want.

    I tried to preserve all of the various things you were trying to
    demonstrate while deleting the unnecessary parts :-)

    Here's some of the bigger issues:

    - You were setting the username rather than the user on the detail page.
    - You were using t:saveState on your table page's user object. Thus,
    you'd set the user/username, and then promptly lose it when the table
    page overwrote the value back to null.
    - You were trying to saveState the value of users (the list of users)
    on the table page, but in reality, this was a constant function call,
    not a settable value. I demonstrated one possible way to do this,
    but there are many.

    Some minor things:
    - You don't need to mess with ListDataModel. Just return a list of your items.
    - You were initializing the value of user. Just leave it null.

    Best practices:
    - Stick a single form in your template. Use sandbox:subForm if you
    want to have virtual forms on each content page.

    I assume you're using prepareForEdit to fetch or create a mutable
    version of the user. If that's not the case, simply change your
    button to action="<Constants.EDIT>" instead of action="#{bean.method}"
    since you don't need to execute any java code. Note that I changed
    this to user = manager.getUser(user) instead of getUser(username) in
    order to keep the example simple. If you don't plan on editing the
    user directly, I'd dump the "user" variable, and save the username of
    the selected user instead.

    <t:updateActionListener
    property="#{userBackingBean.selectedUsername}"
    value="#{user.userName}">


    If possible, consider cleaning up and simplifying this even further
    and making it available either on a wiki page or as a myfaces example.

    On 2/26/07, Mick Knutson wrote:
    I am still having issues it seems. I can display the table just fine and
    then when I click the link, I get sent to
    UserBackingBeanImpl.prepareForEdit() then to my edit user
    form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.java file
    here..

    I really appreciate your help.


    On 2/23/07, Mike Kienenberger wrote:
    The following should work.

    <t:saveState id="user" value="#{ userBackingBean.user}" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with the
    same id.

    You'll need to be sure that the id is unique (I generally use the page
    name followed by the item to preserve, ie. viewUsersPageSelectedUser.

    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{ userBackingBean.users}"
    />
    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then be able
    to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make everything
    session scoped as it gives me these strange errors so I changed them all
    back to request.

    So how should I implement this t:saveState ??? On my userTable.xhtml:

    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An easy
    test is to make it session-scoped temporarily and see if that works.
    If it does, a better fix in my opinion is to either use t:saveState
    on
    userBackingBean.user (if you don't need to preserve the whole bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of this
    error.
    It's attempting to assign the HtmlInputText component to the
    value
    of
    username.
    "binding" is for getting a reference to the component on a page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no
    parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by:
    javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username, newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText
    method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue
    (ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by:
    java.lang.IllegalArgumentException:
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0 (Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{ userBackingBean.user.username} is a String as it should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{ userBackingBean.user.username
    }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    (ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    ( FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java :72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{ user.username }"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    You have to include the tag handler java class as well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander like:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46 PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java :281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    (ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (
    SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java :672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile (
    JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java :96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more



    On 2/22/07, Jeff Bischoff wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be
    something like
    userByUsername?username=#{ user.username} to fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a parameter of
    the


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mick Knutson at Feb 27, 2007 at 7:40 pm
    I updated what you sent, and have some issues still.

    1. I tried using the List users; but the form did you come up at all. So I
    changed it to:
    public ListDataModel getUsers();


    Then when I did that, I get this error:


    java.lang.IllegalArgumentException: Link is not embedded in a form. Change
    component/tag '_id2:0:userpk' from javax.faces.*/<h:tagName /> to
    org.apache.myf
    aces.*/<t:tagName />, or embed it in a form. This is not a bug. Please see:
    http://wiki.apache.org/myfaces/Upgrading_to_Tomahawk_1.1.3 The path to this
    co
    mponent is {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId:
    /views/admin/users.xhtml][Class:
    org.apache.myfaces.component.html.ext.HtmlDa
    taTable,Id: _id2][Class: javax.faces.component.UIColumn,Id: _id3][Class:
    javax.faces.component.html.HtmlCommandLink,Id: userpk]}. If you need to
    render a s
    pecial form and a JSF-form's attributes are not enough,consider using the
    s:form tag of the MyFaces sandbox.





    On 2/26/07, Mike Kienenberger wrote:

    Not sure why this bounced as spam. Maybe it was the zip attachment.
    Trying the pieces as individuals.

    ---------- Forwarded message ----------
    From: Mike Kienenberger <mkienenb@gmail.com>
    Date: Feb 26, 2007 11:56 PM
    Subject: Re: t:datatable with commandLink and parameter
    To: MyFaces Discussion <users@myfaces.apache.org>
    Cc: mickknutson@gmail.com


    Here's an example showing what you want.

    I tried to preserve all of the various things you were trying to
    demonstrate while deleting the unnecessary parts :-)

    Here's some of the bigger issues:

    - You were setting the username rather than the user on the detail page.
    - You were using t:saveState on your table page's user object. Thus,
    you'd set the user/username, and then promptly lose it when the table
    page overwrote the value back to null.
    - You were trying to saveState the value of users (the list of users)
    on the table page, but in reality, this was a constant function call,
    not a settable value. I demonstrated one possible way to do this,
    but there are many.

    Some minor things:
    - You don't need to mess with ListDataModel. Just return a list of your
    items.
    - You were initializing the value of user. Just leave it null.

    Best practices:
    - Stick a single form in your template. Use sandbox:subForm if you
    want to have virtual forms on each content page.

    I assume you're using prepareForEdit to fetch or create a mutable
    version of the user. If that's not the case, simply change your
    button to action="<Constants.EDIT>" instead of action="#{bean.method}"
    since you don't need to execute any java code. Note that I changed
    this to user = manager.getUser(user) instead of getUser(username) in
    order to keep the example simple. If you don't plan on editing the
    user directly, I'd dump the "user" variable, and save the username of
    the selected user instead.

    <t:updateActionListener
    property="#{userBackingBean.selectedUsername}"
    value="#{user.userName}">


    If possible, consider cleaning up and simplifying this even further
    and making it available either on a wiki page or as a myfaces example.

    On 2/26/07, Mick Knutson wrote:
    I am still having issues it seems. I can display the table just fine and
    then when I click the link, I get sent to
    UserBackingBeanImpl.prepareForEdit() then to my edit user
    form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.java file
    here..

    I really appreciate your help.


    On 2/23/07, Mike Kienenberger wrote:
    The following should work.

    <t:saveState id="user" value="#{ userBackingBean.user}" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with the
    same id.

    You'll need to be sure that the id is unique (I generally use the page
    name followed by the item to preserve, ie. viewUsersPageSelectedUser.

    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{
    userBackingBean.users}"
    />
    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then be
    able
    to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make
    everything
    session scoped as it gives me these strange errors so I changed them
    all
    back to request.

    So how should I implement this t:saveState ??? On my
    userTable.xhtml:
    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An
    easy
    test is to make it session-scoped temporarily and see if that
    works.
    If it does, a better fix in my opinion is to either use
    t:saveState
    on
    userBackingBean.user (if you don't need to preserve the whole
    bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence
    I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{userBackingBean.user.username}" is the cause of
    this
    error.
    It's attempting to assign the HtmlInputText component to the
    value
    of
    username.
    "binding" is for getting a reference to the component on a
    page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no
    parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by:
    javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username,
    newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText
    method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(
    LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue
    (ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue(
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java
    :68)
    ... 67 more
    Caused by:
    java.lang.IllegalArgumentException:
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0 (Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(
    NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java
    :25)
    at java.lang.reflect.Method.invoke(Method.java
    :585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{ userBackingBean.user.username} is a String as it
    should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{
    userBackingBean.user.username
    }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's
    a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>

    On 2/23/07, Mick Knutson wrote:
    I got the form to come up, but when I click the
    username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    (ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java
    :264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    ( FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java :72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java
    :110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{userBackingBean.user.username
    }" value="#{ user.username }"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    You have to include the tag handler java class as
    well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander
    like:
    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46
    PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java :281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java
    :184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    (FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    (ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (
    SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java :672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java:97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java:810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile (
    JspServlet.java:314)
    at
    org.apache.jasper.servlet.JspServlet.service
    (JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java :96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
    SecurityAssociationValve.java:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
    :126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    (PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error
    Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement(
    TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of
    com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more




    On 2/22/07, Jeff Bischoff < jbischoff@klkurz.com>
    wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:

    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>


    But I need the command to be the action to be
    something like
    userByUsername?username=#{ user.username} to
    fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a parameter
    of

    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 27, 2007 at 8:31 pm
    Mick,

    What I sent you is files from a working example :-)

    Not sure why you're having issues, but you can certainly fetch the
    users as a List rather than a DataModel. In two years of working with
    JSF, I've never needed to use DataModel.

    One possible issue is that my example has the form in the layout
    template, not in each page. Perhaps you didn't notice that, and no
    longer have a form on the page?

    On 2/27/07, Mick Knutson wrote:
    I updated what you sent, and have some issues still.

    1. I tried using the List users; but the form did you come up at all. So I
    changed it to:
    public ListDataModel getUsers();


    Then when I did that, I get this error:


    java.lang.IllegalArgumentException: Link is not embedded in
    a form. Change component/tag '_id2:0:userpk' from javax.faces.*/<h:tagName
    /> to org.apache.myf
    aces.*/<t:tagName />, or embed it in a form. This is not a bug. Please see:
    http://wiki.apache.org/myfaces/Upgrading_to_Tomahawk_1.1.3
    The path to this co
    mponent is {Component-Path : [Class:
    javax.faces.component.UIViewRoot,ViewId:
    /views/admin/users.xhtml][Class:
    org.apache.myfaces.component.html.ext.HtmlDa
    taTable,Id: _id2][Class: javax.faces.component.UIColumn,Id: _id3][Class:
    javax.faces.component.html.HtmlCommandLink,Id: userpk]}. If
    you need to render a s
    pecial form and a JSF-form's attributes are not enough,consider using the
    s:form tag of the MyFaces sandbox.






    On 2/26/07, Mike Kienenberger wrote:
    Not sure why this bounced as spam. Maybe it was the zip attachment.
    Trying the pieces as individuals.

    ---------- Forwarded message ----------
    From: Mike Kienenberger < mkienenb@gmail.com>
    Date: Feb 26, 2007 11:56 PM
    Subject: Re: t:datatable with commandLink and parameter
    To: MyFaces Discussion <users@myfaces.apache.org>
    Cc: mickknutson@gmail.com


    Here's an example showing what you want.

    I tried to preserve all of the various things you were trying to
    demonstrate while deleting the unnecessary parts :-)

    Here's some of the bigger issues:

    - You were setting the username rather than the user on the detail page.
    - You were using t:saveState on your table page's user object. Thus,
    you'd set the user/username, and then promptly lose it when the table
    page overwrote the value back to null.
    - You were trying to saveState the value of users (the list of users)
    on the table page, but in reality, this was a constant function call,
    not a settable value. I demonstrated one possible way to do this,
    but there are many.

    Some minor things:
    - You don't need to mess with ListDataModel. Just return a list of your items.
    - You were initializing the value of user. Just leave it null.

    Best practices:
    - Stick a single form in your template. Use sandbox:subForm if you
    want to have virtual forms on each content page.

    I assume you're using prepareForEdit to fetch or create a mutable
    version of the user. If that's not the case, simply change your
    button to action="<Constants.EDIT>" instead of action="#{bean.method}"
    since you don't need to execute any java code. Note that I changed
    this to user = manager.getUser(user) instead of getUser(username) in
    order to keep the example simple. If you don't plan on editing the
    user directly, I'd dump the "user" variable, and save the username of
    the selected user instead.

    <t:updateActionListener
    property="#{userBackingBean.selectedUsername}"
    value="#{user.userName}">


    If possible, consider cleaning up and simplifying this even further
    and making it available either on a wiki page or as a myfaces example.

    On 2/26/07, Mick Knutson wrote:
    I am still having issues it seems. I can display the table just fine and
    then when I click the link, I get sent to
    UserBackingBeanImpl.prepareForEdit() then to my edit
    user
    form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.java file
    here..

    I really appreciate your help.


    On 2/23/07, Mike Kienenberger wrote:
    The following should work.

    <t:saveState id="user" value="#{ userBackingBean.user}" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with the
    same id.

    You'll need to be sure that the id is unique (I generally use the page
    name followed by the item to preserve, ie. viewUsersPageSelectedUser.

    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{
    userBackingBean.users}"
    />
    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then be
    able
    to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make
    everything
    session scoped as it gives me these strange errors so I changed them
    all
    back to request.

    So how should I implement this t:saveState ??? On my
    userTable.xhtml:
    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean is
    request-scoped and not being preserved across requests. An
    easy
    test is to make it session-scoped temporarily and see if that
    works.
    If it does, a better fix in my opinion is to either use
    t:saveState
    on
    userBackingBean.user (if you don't need to preserve the whole
    bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables. Hence
    I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)





    On 2/23/07, Mike Kienenberger wrote:
    binding="#{ userBackingBean.user.username}" is the cause of
    this
    error.
    It's attempting to assign the HtmlInputText component to the
    value
    of
    username.
    "binding" is for getting a reference to the component on a
    page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have no
    parameters in
    the
    action.


    With that completed, there seems to be another issue now.
    Caused by:
    javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username,
    newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText
    method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue
    (ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue (
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by:
    java.lang.IllegalArgumentException :
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0
    (Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke
    (NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    ( DelegatingMethodAccessorImpl.java
    :25)
    at
    java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{ userBackingBean.user.username} is a String as it
    should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{
    userBackingBean.user.username
    }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }






    On 2/23/07, Mike Kienenberger wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing it's
    a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>


    On 2/23/07, Mick Knutson < mickknutson@gmail.com >
    wrote:
    I got the form to come up, but when I click the
    username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    (ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    ( FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java :72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username
    ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{ user.username }"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    You have to include the tag handler java class as
    well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson wrote:
    I tried to add this to my facelets tag hander
    like:
    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007 3:25:46
    PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java :281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    ( FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java :173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    ( ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (
    SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java :672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java :97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java :810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile (
    JspServlet.java :314)
    at
    org.apache.jasper.servlet.JspServlet.service
    ( JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java :96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java
    :175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke
    (StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    ( PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error
    Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of
    com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more




    On 2/22/07, Jeff Bischoff < jbischoff@klkurz.com>
    wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:
    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>

    But I need the command to be the action to be
    something like
    userByUsername?username=#{ user.username} to
    fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a parameter
    of
    the
    username
    for
    each
    http://www.myspace.com/djmick_dot_com


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mick Knutson at Feb 27, 2007 at 11:19 pm
    Ok, I got the List thing changed. But this still seems odd:


    15:09:14,761 INFO [STDOUT] 15:09:14,761 INFO [UserBackingBeanImpl]
    UserBackingBean.prepareForEdit(String)
    15:09:14,761 INFO [STDOUT] 15:09:14,761 INFO [UserBackingBeanImpl]
    UserBackingBean.user.username(): mknutson
    .....

    15:09:14,792 INFO [STDOUT] 15:09:14,792 INFO [UserBackingBeanImpl]
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    15:09:14,823 INFO [STDOUT] 15:09:14,823 INFO [UserBackingBeanImpl]
    UserBackingBean.prepareForEdit(String).user.toString():
    com.baselogic.tro.user.User@93912f[username=mknutson,password=[protected]
    ,roles=[com.baselogic.tro.user.Role$$EnhancerByCGLIB$$1d73392c@847c91
    [name=<null>,description=<null>]],accountExpired=true,accountLocked=true,credentialsEx
    pired=true,enabled=true,confirmPassword=<null>,firstName=Mick,email=
    mknutson@baselogic.com,lastName=Knutson,address=2875-F Northtowne
    Lane,address2=#374,ci
    ty=Reno,state=NV,otherState=<null>,postalCode=94110,country=us,cardholder=<null>,card=<null>,expMonth=<null>,expYear=<null>,cvv2=<null>,schedule=<null>,las
    tUpdate=2007-02-21 13:03:35.0,creationDate=2006-11-01 18:24:02.0]
    15:09:14,823 INFO [STDOUT] 15:09:14,823 INFO [UserBackingBeanImpl]
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG [FacesServlet] service end
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG [ExceptionTranslationFilter]
    Chain processed normally
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG
    [HttpSessionContextIntegrationFilter] SecurityContextHolder set to new
    context, as request processing comple
    ted
    15:09:14,839 INFO [STDOUT] 15:09:14,839 DEBUG
    [PathBasedFilterInvocationDefinitionMap] Converted URL to lowercase, from:
    '/views/admin/updateuser.jsf'; to
    : '/views/admin/updateuser.jsf'


    ....

    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userBackingBean' in via original
    VariableResolv
    er
    15:09:14,995 INFO [STDOUT] 15:09:14,995 INFO [UserBackingBeanImpl]
    UserBackingBeanImpl()
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userManager' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userManager' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Successfully resolved variable 'userDao' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DefaultListableBeanFactory]
    Returning cached instance of singleton bean 'userDao'
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Could not resolve variable 'userList'
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in root WebApplicationContext
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG [DelegatingVariableResolver]
    Could not resolve variable 'userList'
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userBackingBean' in via original
    VariableResolv
    er

    ....

    15:09:15,042 INFO [STDOUT] 15:09:15,042 ERROR [HtmlRendererUtils] Error
    finding Converter for component with id masterForm:userBackingBean:country
    javax.faces.el.PropertyNotFoundException: /views/admin/updateUser.xhtml
    @223,73 value="#{userBackingBean.user.country}": Target Unreachable, 'user'
    returne
    d null
    at com.sun.facelets.el.LegacyValueBinding.getType(
    LegacyValueBinding.java:96)
    at
    org.apache.myfaces.shared_tomahawk.renderkit._SharedRendererUtils.findUIOutputConverter
    (_SharedRendererUtils.java:58)
    at
    org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.findUIOutputConverter
    (RendererUtils.java:310)
    at
    org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRendererUtils.findUIOutputConverterFailSafe
    (HtmlRendererUtils.java:367)
    at
    org.apache.myfaces.custom.selectOneCountry.SelectOneCountryRenderer.encodeEnd
    (SelectOneCountryRenderer.java:73)
    at javax.faces.component.UIComponentBase.encodeEnd(
    UIComponentBase.java:539)








    On 2/27/07, Mike Kienenberger wrote:

    Mick,

    What I sent you is files from a working example :-)

    Not sure why you're having issues, but you can certainly fetch the
    users as a List rather than a DataModel. In two years of working with
    JSF, I've never needed to use DataModel.

    One possible issue is that my example has the form in the layout
    template, not in each page. Perhaps you didn't notice that, and no
    longer have a form on the page?

    On 2/27/07, Mick Knutson wrote:
    I updated what you sent, and have some issues still.

    1. I tried using the List users; but the form did you come up at all. So I
    changed it to:
    public ListDataModel getUsers();


    Then when I did that, I get this error:


    java.lang.IllegalArgumentException: Link is not embedded in
    a form. Change component/tag '_id2:0:userpk' from javax.faces.*/
    <h:tagName
    /> to org.apache.myf
    aces.*/<t:tagName />, or embed it in a form. This is not a bug. Please see:
    http://wiki.apache.org/myfaces/Upgrading_to_Tomahawk_1.1.3
    The path to this co
    mponent is {Component-Path : [Class:
    javax.faces.component.UIViewRoot,ViewId:
    /views/admin/users.xhtml][Class:
    org.apache.myfaces.component.html.ext.HtmlDa
    taTable,Id: _id2][Class: javax.faces.component.UIColumn,Id: _id3][Class:
    javax.faces.component.html.HtmlCommandLink,Id: userpk]}. If
    you need to render a s
    pecial form and a JSF-form's attributes are not enough,consider using the
    s:form tag of the MyFaces sandbox.






    On 2/26/07, Mike Kienenberger wrote:
    Not sure why this bounced as spam. Maybe it was the zip attachment.
    Trying the pieces as individuals.

    ---------- Forwarded message ----------
    From: Mike Kienenberger < mkienenb@gmail.com>
    Date: Feb 26, 2007 11:56 PM
    Subject: Re: t:datatable with commandLink and parameter
    To: MyFaces Discussion <users@myfaces.apache.org>
    Cc: mickknutson@gmail.com


    Here's an example showing what you want.

    I tried to preserve all of the various things you were trying to
    demonstrate while deleting the unnecessary parts :-)

    Here's some of the bigger issues:

    - You were setting the username rather than the user on the detail
    page.
    - You were using t:saveState on your table page's user object. Thus,
    you'd set the user/username, and then promptly lose it when the table
    page overwrote the value back to null.
    - You were trying to saveState the value of users (the list of users)
    on the table page, but in reality, this was a constant function call,
    not a settable value. I demonstrated one possible way to do this,
    but there are many.

    Some minor things:
    - You don't need to mess with ListDataModel. Just return a list of
    your
    items.
    - You were initializing the value of user. Just leave it null.

    Best practices:
    - Stick a single form in your template. Use sandbox:subForm if you
    want to have virtual forms on each content page.

    I assume you're using prepareForEdit to fetch or create a mutable
    version of the user. If that's not the case, simply change your
    button to action="<Constants.EDIT>" instead of action="#{bean.method}"
    since you don't need to execute any java code. Note that I changed
    this to user = manager.getUser(user) instead of getUser(username) in
    order to keep the example simple. If you don't plan on editing the
    user directly, I'd dump the "user" variable, and save the username of
    the selected user instead.

    <t:updateActionListener
    property="#{userBackingBean.selectedUsername}"
    value="#{user.userName}">


    If possible, consider cleaning up and simplifying this even further
    and making it available either on a wiki page or as a myfaces example.

    On 2/26/07, Mick Knutson wrote:
    I am still having issues it seems. I can display the table just fine
    and
    then when I click the link, I get sent to
    UserBackingBeanImpl.prepareForEdit() then to my edit
    user
    form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.javafile
    here..

    I really appreciate your help.


    On 2/23/07, Mike Kienenberger wrote:
    The following should work.

    <t:saveState id="user" value="#{ userBackingBean.user}" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with
    the
    same id.

    You'll need to be sure that the id is unique (I generally use the
    page
    name followed by the item to preserve,
    ie. viewUsersPageSelectedUser.
    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I
    normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{
    userBackingBean.users}"
    />
    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then
    be
    able
    to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make
    everything
    session scoped as it gives me these strange errors so I changed
    them
    all
    back to request.

    So how should I implement this t:saveState ??? On my
    userTable.xhtml:
    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean
    is
    request-scoped and not being preserved across
    requests. An
    easy
    test is to make it session-scoped temporarily and see if
    that
    works.
    If it does, a better fix in my opinion is to either use
    t:saveState
    on
    userBackingBean.user (if you don't need to preserve the
    whole
    bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables.
    Hence
    I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)






    On 2/23/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    binding="#{ userBackingBean.user.username}" is the cause
    of
    this
    error.
    It's attempting to assign the HtmlInputText component to
    the
    value
    of
    username.
    "binding" is for getting a reference to the component on
    a
    page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have
    no
    parameters in
    the
    action.


    With that completed, there seems to be another issue
    now.
    Caused by:
    javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username,
    newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText
    method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(
    LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue
    (ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue (
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java
    :68)
    ... 67 more
    Caused by:
    java.lang.IllegalArgumentException :
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0
    (Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke
    (NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    ( DelegatingMethodAccessorImpl.java
    :25)
    at
    java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{ userBackingBean.user.username} is a String as
    it
    should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{
    userBackingBean.user.username
    }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }







    On 2/23/07, Mike Kienenberger < mkienenb@gmail.com>
    wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing
    it's
    a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>


    On 2/23/07, Mick Knutson < mickknutson@gmail.com >
    wrote:
    I got the form to come up, but when I click the
    username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling
    action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    (ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(
    FilterChainProxy.java
    :264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    ( FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java :72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(
    ExceptionTranslationFilter.java
    :110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username
    ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{ user.username }"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com>
    wrote:
    You have to include the tag handler java class
    as
    well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson < mickknutson@gmail.com
    wrote:
    I tried to add this to my facelets tag hander
    like:
    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007
    3:25:46
    PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java :281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java
    :184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    ( FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java :173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    ( ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (
    SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    (FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java :672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    (PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java :97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java :810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile (
    JspServlet.java :314)
    at
    org.apache.jasper.servlet.JspServlet.service
    ( JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java :96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
    SecurityAssociationValve.java
    :175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke
    (StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    (ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    ( PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at java.lang.Thread.run(Thread.java
    :595)
    Caused by: org.xml.sax.SAXException : Error
    Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of
    com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more




    On 2/22/07, Jeff Bischoff <
    jbischoff@klkurz.com>
    wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:
    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>

    But I need the command to be the action to
    be
    something like
    userByUsername?username=#{ user.username}
    to
    fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a
    parameter


    --
    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 27, 2007 at 11:47 pm
    Mick,

    Instead of just dumping output, you need to describe what incorrect
    behavior you're seeing, and what you expect to see differently.

    In this particular case, I can guess what the problem is and why, but
    no one else would be able to do so.

    The problem is that you deleted the

    <t:saveState
    id="user"
    value="#{userBackingBean.user}" />

    component that was preserving the value of user.

    On 2/27/07, Mick Knutson wrote:
    Ok, I got the List thing changed. But this still seems odd:


    15:09:14,761 INFO [STDOUT] 15:09:14,761 INFO [UserBackingBeanImpl]
    UserBackingBean.prepareForEdit(String)
    15:09:14,761 INFO [STDOUT] 15:09:14,761 INFO [UserBackingBeanImpl]
    UserBackingBean.user.username(): mknutson
    .....

    15:09:14,792 INFO [STDOUT] 15:09:14,792 INFO [UserBackingBeanImpl]
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    15:09:14,823 INFO [STDOUT] 15:09:14,823 INFO [UserBackingBeanImpl]
    UserBackingBean.prepareForEdit(String).user.toString():
    com.baselogic.tro.user.User@93912f[username=mknutson,password=[protected]
    ,roles=[com.baselogic.tro.user.Role$$EnhancerByCGLIB$$1d73392c@847c91[name=<null>,description=<null>]],accountExpired=true,accountLocked=true,credentialsEx
    pired=true,enabled=true,confirmPassword=<null>,firstName=Mick,email=mknutson@baselogic.com,lastName=Knutson,address=2875-F
    Northtowne Lane,address2=#374,ci
    ty=Reno,state=NV,otherState=<null>,postalCode=94110,country=us,cardholder=<null>,card=<null>,expMonth=<null>,expYear=<null>,cvv2=<null>,schedule=<null>,las
    tUpdate=2007-02-21 13:03:35.0,creationDate=2006-11-01 18:24:02.0]
    15:09:14,823 INFO [STDOUT] 15:09:14,823 INFO [UserBackingBeanImpl]
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG [FacesServlet] service end
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG [ExceptionTranslationFilter]
    Chain processed normally
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG
    [HttpSessionContextIntegrationFilter] SecurityContextHolder
    set to new context, as request processing comple
    ted
    15:09:14,839 INFO [STDOUT] 15:09:14,839 DEBUG
    [PathBasedFilterInvocationDefinitionMap] Converted URL to
    lowercase, from: '/views/admin/updateuser.jsf'; to
    : '/views/admin/updateuser.jsf'


    ....

    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userBackingBean' in via original
    VariableResolv
    er
    15:09:14,995 INFO [STDOUT] 15:09:14,995 INFO [UserBackingBeanImpl]
    UserBackingBeanImpl()
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userManager' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userManager' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Successfully resolved variable 'userDao' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DefaultListableBeanFactory]
    Returning cached instance of singleton bean 'userDao'
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Could not resolve variable 'userList'
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in root WebApplicationContext
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG [DelegatingVariableResolver]
    Could not resolve variable 'userList'
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userBackingBean' in via original
    VariableResolv
    er

    ....

    15:09:15,042 INFO [STDOUT] 15:09:15,042 ERROR [HtmlRendererUtils] Error
    finding Converter for component with id
    masterForm:userBackingBean:country
    javax.faces.el.PropertyNotFoundException:
    /views/admin/updateUser.xhtml @223,73 value="#{
    userBackingBean.user.country}": Target Unreachable, 'user' returne
    d null
    at com.sun.facelets.el.LegacyValueBinding.getType
    (LegacyValueBinding.java:96)
    at
    org.apache.myfaces.shared_tomahawk.renderkit._SharedRendererUtils.findUIOutputConverter(_SharedRendererUtils.java:58)
    at
    org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.findUIOutputConverter
    (RendererUtils.java:310)
    at
    org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRendererUtils.findUIOutputConverterFailSafe(HtmlRendererUtils.java:367)
    at
    org.apache.myfaces.custom.selectOneCountry.SelectOneCountryRenderer.encodeEnd
    (SelectOneCountryRenderer.java:73)
    at
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)









    On 2/27/07, Mike Kienenberger wrote:
    Mick,

    What I sent you is files from a working example :-)

    Not sure why you're having issues, but you can certainly fetch the
    users as a List rather than a DataModel. In two years of working with
    JSF, I've never needed to use DataModel.

    One possible issue is that my example has the form in the layout
    template, not in each page. Perhaps you didn't notice that, and no
    longer have a form on the page?

    On 2/27/07, Mick Knutson wrote:
    I updated what you sent, and have some issues still.

    1. I tried using the List users; but the form did you come up at all. So
    I
    changed it to:
    public ListDataModel getUsers();


    Then when I did that, I get this error:


    java.lang.IllegalArgumentException: Link is not
    embedded in
    a form. Change component/tag '_id2:0:userpk' from
    javax.faces.*/<h:tagName
    /> to org.apache.myf
    aces.*/<t:tagName />, or embed it in a form. This is not a bug. Please
    see:
    http://wiki.apache.org/myfaces/Upgrading_to_Tomahawk_1.1.3
    The path to this co
    mponent is {Component-Path : [Class:
    javax.faces.component.UIViewRoot,ViewId:
    /views/admin/users.xhtml][Class:
    org.apache.myfaces.component.html.ext.HtmlDa
    taTable,Id: _id2][Class: javax.faces.component.UIColumn,Id: _id3][Class:
    javax.faces.component.html.HtmlCommandLink,Id:
    userpk]}. If
    you need to render a s
    pecial form and a JSF-form's attributes are not enough,consider using
    the
    s:form tag of the MyFaces sandbox.






    On 2/26/07, Mike Kienenberger wrote:
    Not sure why this bounced as spam. Maybe it was the zip attachment.
    Trying the pieces as individuals.

    ---------- Forwarded message ----------
    From: Mike Kienenberger < mkienenb@gmail.com>
    Date: Feb 26, 2007 11:56 PM
    Subject: Re: t:datatable with commandLink and parameter
    To: MyFaces Discussion < users@myfaces.apache.org>
    Cc: mickknutson@gmail.com


    Here's an example showing what you want.

    I tried to preserve all of the various things you were trying to
    demonstrate while deleting the unnecessary parts :-)

    Here's some of the bigger issues:

    - You were setting the username rather than the user on the detail
    page.
    - You were using t:saveState on your table page's user object. Thus,
    you'd set the user/username, and then promptly lose it when the table
    page overwrote the value back to null.
    - You were trying to saveState the value of users (the list of users)
    on the table page, but in reality, this was a constant function call,
    not a settable value. I demonstrated one possible way to do this,
    but there are many.

    Some minor things:
    - You don't need to mess with ListDataModel. Just return a list of
    your
    items.
    - You were initializing the value of user. Just leave it null.

    Best practices:
    - Stick a single form in your template. Use sandbox:subForm if you
    want to have virtual forms on each content page.

    I assume you're using prepareForEdit to fetch or create a mutable
    version of the user. If that's not the case, simply change your
    button to action="<Constants.EDIT>" instead of action="#{bean.method}"
    since you don't need to execute any java code. Note that I changed
    this to user = manager.getUser(user) instead of getUser(username) in
    order to keep the example simple. If you don't plan on editing the
    user directly, I'd dump the "user" variable, and save the username of
    the selected user instead.

    <t:updateActionListener
    property="#{userBackingBean.selectedUsername}"
    value="#{user.userName}">


    If possible, consider cleaning up and simplifying this even further
    and making it available either on a wiki page or as a myfaces example.

    On 2/26/07, Mick Knutson wrote:
    I am still having issues it seems. I can display the table just fine
    and
    then when I click the link, I get sent to
    UserBackingBeanImpl.prepareForEdit() then to my
    edit
    user
    form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.java
    file
    here..

    I really appreciate your help.


    On 2/23/07, Mike Kienenberger wrote:
    The following should work.

    <t:saveState id="user" value="#{ userBackingBean.user }" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with
    the
    same id.

    You'll need to be sure that the id is unique (I generally use the
    page
    name followed by the item to preserve, ie.
    viewUsersPageSelectedUser.
    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I
    normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{
    userBackingBean.users}"
    />
    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then
    be
    able
    to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make
    everything
    session scoped as it gives me these strange errors so I changed
    them
    all
    back to request.

    So how should I implement this t:saveState ??? On my
    userTable.xhtml :
    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean
    is
    request-scoped and not being preserved across requests.
    An
    easy
    test is to make it session-scoped temporarily and see if
    that
    works.
    If it does, a better fix in my opinion is to either use
    t:saveState
    on
    userBackingBean.user (if you don't need to preserve the
    whole
    bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables.
    Hence
    I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)






    On 2/23/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    binding="#{ userBackingBean.user.username }" is the
    cause of
    this
    error.
    It's attempting to assign the HtmlInputText component to
    the
    value
    of
    username.
    "binding" is for getting a reference to the component on
    a
    page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have
    no
    parameters in
    the
    action.


    With that completed, there seems to be another issue
    now.
    Caused by:
    javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username,
    newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText
    method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue
    (ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue (
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by:
    java.lang.IllegalArgumentException :
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0
    (Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke
    (NativeMethodAccessorImpl.java :39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    ( DelegatingMethodAccessorImpl.java
    :25)
    at
    java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{ userBackingBean.user.username} is a String as
    it
    should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{
    userBackingBean.user.username
    }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }







    On 2/23/07, Mike Kienenberger < mkienenb@gmail.com>
    wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing
    it's
    a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>


    On 2/23/07, Mick Knutson < mickknutson@gmail.com >
    wrote:
    I got the form to come up, but when I click the
    username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling
    action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    ( ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    ( FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java :72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java :274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    ( FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username
    ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{ user.username }"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com
    wrote:
    You have to include the tag handler java class
    as
    well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson < mickknutson@gmail.com
    wrote:
    I tried to add this to my facelets tag hander
    like:
    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007
    3:25:46
    PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    ( TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java :281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    ( FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    ( ApplicationFilterChain.java :173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    ( ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (
    SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    ( FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    ( ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java :672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    ( PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java :97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java :810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile
    (
    JspServlet.java :314)
    at
    org.apache.jasper.servlet.JspServlet.service
    ( JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java :96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java
    :175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke
    (StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    ( ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    ( PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at
    java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error
    Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of
    com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more




    On 2/22/07, Jeff Bischoff <
    jbischoff@klkurz.com>
    wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:
    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>

    But I need the command to be the action to
    be
    something like
    userByUsername?username=#{ user.username}
    to
    fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a
    parameter
    http://www.myspace.com/djmick_dot_com
    http://www.myspace.com/djmick_dot_com


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mike Kienenberger at Feb 27, 2007 at 11:49 pm
    The problem is that you deleted the

    <t:saveState
    id="user"
    value="#{userBackingBean.user}" />

    component that was preserving the value of user.
    in your user detail page, not in your user list page.
    On 2/27/07, Mike Kienenberger wrote:
    Mick,

    Instead of just dumping output, you need to describe what incorrect
    behavior you're seeing, and what you expect to see differently.

    In this particular case, I can guess what the problem is and why, but
    no one else would be able to do so.

    The problem is that you deleted the

    <t:saveState
    id="user"
    value="#{userBackingBean.user}" />

    component that was preserving the value of user.

    On 2/27/07, Mick Knutson wrote:
    Ok, I got the List thing changed. But this still seems odd:


    15:09:14,761 INFO [STDOUT] 15:09:14,761 INFO [UserBackingBeanImpl]
    UserBackingBean.prepareForEdit(String)
    15:09:14,761 INFO [STDOUT] 15:09:14,761 INFO [UserBackingBeanImpl]
    UserBackingBean.user.username(): mknutson
    .....

    15:09:14,792 INFO [STDOUT] 15:09:14,792 INFO [UserBackingBeanImpl]
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    15:09:14,823 INFO [STDOUT] 15:09:14,823 INFO [UserBackingBeanImpl]
    UserBackingBean.prepareForEdit(String).user.toString():
    com.baselogic.tro.user.User@93912f[username=mknutson,password=[protected]
    ,roles=[com.baselogic.tro.user.Role$$EnhancerByCGLIB$$1d73392c@847c91[name=<null>,description=<null>]],accountExpired=true,accountLocked=true,credentialsEx
    pired=true,enabled=true,confirmPassword=<null>,firstName=Mick,email=mknutson@baselogic.com,lastName=Knutson,address=2875-F
    Northtowne Lane,address2=#374,ci
    ty=Reno,state=NV,otherState=<null>,postalCode=94110,country=us,cardholder=<null>,card=<null>,expMonth=<null>,expYear=<null>,cvv2=<null>,schedule=<null>,las
    tUpdate=2007-02-21 13:03:35.0,creationDate=2006-11-01 18:24:02.0]
    15:09:14,823 INFO [STDOUT] 15:09:14,823 INFO [UserBackingBeanImpl]
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG [FacesServlet] service end
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG [ExceptionTranslationFilter]
    Chain processed normally
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG
    [HttpSessionContextIntegrationFilter] SecurityContextHolder
    set to new context, as request processing comple
    ted
    15:09:14,839 INFO [STDOUT] 15:09:14,839 DEBUG
    [PathBasedFilterInvocationDefinitionMap] Converted URL to
    lowercase, from: '/views/admin/updateuser.jsf'; to
    : '/views/admin/updateuser.jsf'


    ....

    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userBackingBean' in via original
    VariableResolv
    er
    15:09:14,995 INFO [STDOUT] 15:09:14,995 INFO [UserBackingBeanImpl]
    UserBackingBeanImpl()
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userManager' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userManager' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Successfully resolved variable 'userDao' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DefaultListableBeanFactory]
    Returning cached instance of singleton bean 'userDao'
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in via original VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG [DelegatingVariableResolver]
    Could not resolve variable 'userList'
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in root WebApplicationContext
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG [DelegatingVariableResolver]
    Could not resolve variable 'userList'
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG [DelegatingVariableResolver]
    Attempting to resolve variable 'userBackingBean' in via original
    VariableResolv
    er

    ....

    15:09:15,042 INFO [STDOUT] 15:09:15,042 ERROR [HtmlRendererUtils] Error
    finding Converter for component with id
    masterForm:userBackingBean:country
    javax.faces.el.PropertyNotFoundException:
    /views/admin/updateUser.xhtml @223,73 value="#{
    userBackingBean.user.country}": Target Unreachable, 'user' returne
    d null
    at com.sun.facelets.el.LegacyValueBinding.getType
    (LegacyValueBinding.java:96)
    at
    org.apache.myfaces.shared_tomahawk.renderkit._SharedRendererUtils.findUIOutputConverter(_SharedRendererUtils.java:58)
    at
    org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.findUIOutputConverter
    (RendererUtils.java:310)
    at
    org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRendererUtils.findUIOutputConverterFailSafe(HtmlRendererUtils.java:367)
    at
    org.apache.myfaces.custom.selectOneCountry.SelectOneCountryRenderer.encodeEnd
    (SelectOneCountryRenderer.java:73)
    at
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)









    On 2/27/07, Mike Kienenberger wrote:
    Mick,

    What I sent you is files from a working example :-)

    Not sure why you're having issues, but you can certainly fetch the
    users as a List rather than a DataModel. In two years of working with
    JSF, I've never needed to use DataModel.

    One possible issue is that my example has the form in the layout
    template, not in each page. Perhaps you didn't notice that, and no
    longer have a form on the page?

    On 2/27/07, Mick Knutson wrote:
    I updated what you sent, and have some issues still.

    1. I tried using the List users; but the form did you come up at all. So
    I
    changed it to:
    public ListDataModel getUsers();


    Then when I did that, I get this error:


    java.lang.IllegalArgumentException: Link is not
    embedded in
    a form. Change component/tag '_id2:0:userpk' from
    javax.faces.*/<h:tagName
    /> to org.apache.myf
    aces.*/<t:tagName />, or embed it in a form. This is not a bug. Please
    see:
    http://wiki.apache.org/myfaces/Upgrading_to_Tomahawk_1.1.3
    The path to this co
    mponent is {Component-Path : [Class:
    javax.faces.component.UIViewRoot,ViewId:
    /views/admin/users.xhtml][Class:
    org.apache.myfaces.component.html.ext.HtmlDa
    taTable,Id: _id2][Class: javax.faces.component.UIColumn,Id: _id3][Class:
    javax.faces.component.html.HtmlCommandLink,Id:
    userpk]}. If
    you need to render a s
    pecial form and a JSF-form's attributes are not enough,consider using
    the
    s:form tag of the MyFaces sandbox.






    On 2/26/07, Mike Kienenberger wrote:
    Not sure why this bounced as spam. Maybe it was the zip attachment.
    Trying the pieces as individuals.

    ---------- Forwarded message ----------
    From: Mike Kienenberger < mkienenb@gmail.com>
    Date: Feb 26, 2007 11:56 PM
    Subject: Re: t:datatable with commandLink and parameter
    To: MyFaces Discussion < users@myfaces.apache.org>
    Cc: mickknutson@gmail.com


    Here's an example showing what you want.

    I tried to preserve all of the various things you were trying to
    demonstrate while deleting the unnecessary parts :-)

    Here's some of the bigger issues:

    - You were setting the username rather than the user on the detail
    page.
    - You were using t:saveState on your table page's user object. Thus,
    you'd set the user/username, and then promptly lose it when the table
    page overwrote the value back to null.
    - You were trying to saveState the value of users (the list of users)
    on the table page, but in reality, this was a constant function call,
    not a settable value. I demonstrated one possible way to do this,
    but there are many.

    Some minor things:
    - You don't need to mess with ListDataModel. Just return a list of
    your
    items.
    - You were initializing the value of user. Just leave it null.

    Best practices:
    - Stick a single form in your template. Use sandbox:subForm if you
    want to have virtual forms on each content page.

    I assume you're using prepareForEdit to fetch or create a mutable
    version of the user. If that's not the case, simply change your
    button to action="<Constants.EDIT>" instead of action="#{bean.method}"
    since you don't need to execute any java code. Note that I changed
    this to user = manager.getUser(user) instead of getUser(username) in
    order to keep the example simple. If you don't plan on editing the
    user directly, I'd dump the "user" variable, and save the username of
    the selected user instead.

    <t:updateActionListener
    property="#{userBackingBean.selectedUsername}"
    value="#{user.userName}">


    If possible, consider cleaning up and simplifying this even further
    and making it available either on a wiki page or as a myfaces example.

    On 2/26/07, Mick Knutson wrote:
    I am still having issues it seems. I can display the table just fine
    and
    then when I click the link, I get sent to
    UserBackingBeanImpl.prepareForEdit() then to my
    edit
    user
    form, but there is still no data shown.

    I have attached the 2 xhrml files and the UserBackingBeanImpl.java
    file
    here..

    I really appreciate your help.


    On 2/23/07, Mike Kienenberger wrote:
    The following should work.

    <t:saveState id="user" value="#{ userBackingBean.user }" />

    You'll want to set this on the "receiving" page, the page with the
    editable form (user detail page). You can also preserve values
    across pages by putting the same t:saveState on both pages with
    the
    same id.

    You'll need to be sure that the id is unique (I generally use the
    page
    name followed by the item to preserve, ie.
    viewUsersPageSelectedUser.
    The other thing you need to be sure of is that your UIData list is
    also preserved, but preserveDataModel="true" should work. I
    normally
    use a t:saveState to do this, though, and never preserveDataModel.


    <t:saveState id="viewUsersPageUserList" value="#{
    userBackingBean.users}"
    />
    On 2/23/07, Mick Knutson wrote:
    The only thing I am trying to do is view a list of users. Then
    be
    able
    to
    click the username, pull up that user in an editable form.




    On 2/23/07, Mick Knutson wrote:
    Because I am using the jsf-acegi in my app, I can't make
    everything
    session scoped as it gives me these strange errors so I changed
    them
    all
    back to request.

    So how should I implement this t:saveState ??? On my
    userTable.xhtml :
    <x:saveState id="user" value="#{userBackingBean.user}" />
    ???




    On 2/23/07, Mike Kienenberger wrote:
    Not enough information, but my guess is that userBackingBean
    is
    request-scoped and not being preserved across requests.
    An
    easy
    test is to make it session-scoped temporarily and see if
    that
    works.
    If it does, a better fix in my opinion is to either use
    t:saveState
    on
    userBackingBean.user (if you don't need to preserve the
    whole
    bean)
    or
    userBackingBean (if you do).
    On 2/23/07, Mick Knutson wrote:
    Ok, thanks.

    But now, I have a UserBackingBean.user =
    manager.getUser(user.getUsername());

    then:
    outcome = Constants.SUCCESS;

    But the form does not display any of the user variables.
    Hence
    I
    thought I
    had to bind those variables which was wrong.....

    You help is greatly appreciated by the way... :-)






    On 2/23/07, Mike Kienenberger < mkienenb@gmail.com >
    wrote:
    binding="#{ userBackingBean.user.username }" is the
    cause of
    this
    error.
    It's attempting to assign the HtmlInputText component to
    the
    value
    of
    username.
    "binding" is for getting a reference to the component on
    a
    page
    into
    your backing bean.
    On 2/23/07, Mick Knutson wrote:
    The issue was in my method signature. I needed to have
    no
    parameters in
    the
    action.


    With that completed, there seems to be another issue
    now.
    Caused by:
    javax.faces.el.EvaluationException:
    Bean:
    com.baselogic.tro.user.User , property: username,
    newValue:
    javax.faces.component.html.HtmlInputText@10
    90c56,newValue class:
    javax.faces.component.html.HtmlInputText
    method
    parameter
    class: java.lang.String
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java:414)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setValue
    (PropertyResolverImpl.java:176)
    at
    com.sun.facelets.el.LegacyELContext$LegacyELResolver.setValue(LegacyELContext.java
    :201)
    at
    com.sun.el.parser.AstValue.setValue(AstValue.java
    :113)
    at
    com.sun.el.ValueExpressionImpl.setValue
    (ValueExpressionImpl.java:246)
    at
    com.sun.facelets.el.TagValueExpression.setValue (
    TagValueExpression.java:93)
    at
    com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:68)
    ... 67 more
    Caused by:
    java.lang.IllegalArgumentException :
    argument
    type mismatch
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0
    (Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke
    (NativeMethodAccessorImpl.java :39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke
    ( DelegatingMethodAccessorImpl.java
    :25)
    at
    java.lang.reflect.Method.invoke(Method.java:585)
    at
    org.apache.myfaces.el.PropertyResolverImpl.setProperty
    (PropertyResolverImpl.java
    :409)
    ... 73 more



    My #{ userBackingBean.user.username} is a String as
    it
    should
    be
    as this
    is
    just a POJO

    <h:inputText value="#{
    userBackingBean.user.username
    }"
    size="30"
    required="true"
    id="username"
    binding="#{userBackingBean.user.username }"
    <f:validateLength minimum="2"/>
    </h:inputText>


    User.username:

    public String getUsername() {
    return username;

    }







    On 2/23/07, Mike Kienenberger < mkienenb@gmail.com>
    wrote:
    Add an id field to make sure it's an error for the
    t:commandLink
    you
    posted.
    is there more stack trace available? I'm guessing
    it's
    a
    problem with
    userBackingBean.prepareForEdit().


    <t:commandLink action="#{
    userBackingBean.prepareForEdit}">
    <h:outputText
    value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{user.username}"/>
    </t:commandLink>


    On 2/23/07, Mick Knutson < mickknutson@gmail.com >
    wrote:
    I got the form to come up, but when I click the
    username
    link,
    I get
    this
    error:


    javax.servlet.ServletException: Error calling
    action
    method of
    component
    with id usersForm:_id2:0:_id5
    javax.faces.webapp.FacesServlet.service
    (FacesServlet.java :154)
    org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
    ( ExtensionsFilter.java:147)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java
    :264)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    ( FilterSecurityInterceptor.java :107)
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java :72)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java
    :110)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (SecurityContextHolderAwareRequestFilter.java
    :81)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (
    HttpSessionContextIntegrationFilter.java:229)
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java :274)
    org.acegisecurity.util.FilterChainProxy.doFilter
    ( FilterChainProxy.java :148)
    org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java
    :98)


    Here is the users.xhtml form:

    <h:form id="usersForm">
    <t:dataTable value="#{
    userBackingBean.users }"
    var="user"
    preserveDataModel="true"
    styleClass="users"
    headerClass="usersHeader"

    rowClasses="evenRow, oddRow"
    columnClasses="username,name"
    border="0"
    <h:column>

    <f:facet name="header">
    <h:outputText value="#{messages['label.username
    ']}"/>
    </f:facet>
    <t:commandLink action="#{
    userBackingBean.prepareForEdit }">
    <h:outputText value="#{ user.username}"/>
    <t:updateActionListener
    property="#{ userBackingBean.user.username
    }" value="#{ user.username }"/>
    </t:commandLink>
    </h:column>



    Here is the faces-config:


    <!-- Edit User -->
    <navigation-rule>
    <from-view-id>/views/admin/users.xhtml</from-view-id>
    <navigation-case>
    <from-action>prepareForEdit</from-action>
    <to-view-id>/views/admin/updateUser.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>clear</from-outcome>
    <to-view-id>/views/admin/users.xhtml</to-view-id>
    <redirect/>

    </navigation-case>
    </navigation-rule>






    On 2/22/07, Mike Kienenberger < mkienenb@gmail.com
    wrote:
    You have to include the tag handler java class
    as
    well.
    http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk#updateActionListener
    On 2/22/07, Mick Knutson < mickknutson@gmail.com
    wrote:
    I tried to add this to my facelets tag hander
    like:
    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    </handler-class>
    </tag>

    </facelet-taglib>


    and I tried:

    <tag>
    <tag-name>updateActionListener</tag-name>
    <handler-class>org.apache.myfaces.custom.updateactionlistener.UpdateActionListenerTag
    </handler-class>
    </tag>





    but still get this error:



    15:25:46,696 ERROR [STDERR] Feb 22, 2007
    3:25:46
    PM
    com.sun.facelets.FaceletViewHandler
    initializeCompiler
    SEVERE: Error Loading Library:
    /WEB-INF/facelets/tags/tomahawk.taglib.xml
    java.io.IOException: Error parsing
    [jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml]:
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    ( TagLibraryConfig.java:396)
    at
    com.sun.facelets.FaceletViewHandler.initializeCompiler
    (FaceletViewHandler.java :281)
    at
    com.sun.facelets.FaceletViewHandler.initialize(FaceletViewHandler.java:184)
    at
    com.sun.facelets.FaceletViewHandler.renderView
    ( FaceletViewHandler.java:421)
    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:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    ( ApplicationFilterChain.java :173)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:264)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke
    (FilterSecurityInterceptor.java :107)
    at
    org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter
    (FilterSecurityInterceptor.java
    :72)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.ui.ExceptionTranslationFilter.doFilter
    ( ExceptionTranslationFilter.java
    :110)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java
    :274)
    at
    org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter
    (
    SecurityContextHolderAwareRequestFilter.java
    :81)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    (FilterChainProxy.java:274)
    at
    org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter
    (HttpSessionContextIntegrationFilter.java
    :229)
    at
    org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter
    ( FilterChainProxy.java:274)
    at
    org.acegisecurity.util.FilterChainProxy.doFilter
    (FilterChainProxy.java :148)
    at
    org.acegisecurity.util.FilterToBeanProxy.doFilter
    ( FilterToBeanProxy.java :98)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    ( ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    ( ApplicationDispatcher.java :672)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest
    (ApplicationDispatcher.java:463)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java
    :398)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward
    ( PageContextImpl.java:703)
    at
    org.apache.jasper.runtime.PageContextImpl.forward
    ( PageContextImpl.java:670)
    at
    org.apache.jsp.index_jsp._jspService
    (index_jsp.java:57)
    at
    org.apache.jasper.runtime.HttpJspBase.service
    (HttpJspBase.java :97)
    at
    javax.servlet.http.HttpServlet.service
    (HttpServlet.java :810)
    at
    org.apache.jasper.servlet.JspServletWrapper.service
    ( JspServletWrapper.java:332)
    at
    org.apache.jasper.servlet.JspServlet.serviceJspFile
    (
    JspServlet.java :314)
    at
    org.apache.jasper.servlet.JspServlet.service
    ( JspServlet.java:264)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
    (ReplyHeaderFilter.java :96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    ( ApplicationFilterChain.java :202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java
    :173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java
    :213)
    at
    org.apache.catalina.core.StandardContextValve.invoke
    (
    StandardContextValve.java
    :178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java
    :175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke
    (JaccContextValve.java
    :74)
    at
    org.apache.catalina.core.StandardHostValve.invoke
    (StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke
    ( ErrorReportValve.java:105)
    at
    org.apache.catalina.core.StandardEngineValve.invoke
    (StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service
    (CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
    ( PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run
    (MasterSlaveWorkerThread.java
    :112)
    at
    java.lang.Thread.run(Thread.java:595)
    Caused by: org.xml.sax.SAXException : Error
    Handling [
    jndi:/localhost/tro/WEB-INF/facelets/tags/tomahawk.taglib.xml@393
    ,107]
    <handler-class>
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java
    :258)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.dtd.XMLDTDValidator.endElement
    (Unknown Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch
    (Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.DTDConfiguration.parse
    (Unknown Source)
    at
    org.apache.xerces.parsers.XMLParser.parse
    (Unknown
    Source)
    at
    org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse
    (Unknown Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    javax.xml.parsers.SAXParser.parse(Unknown
    Source)
    at
    com.sun.facelets.compiler.TagLibraryConfig.create
    (TagLibraryConfig.java
    :393)
    ... 53 more
    Caused by: java.lang.Exception :
    org.apache.myfaces.custom.updateactionlistener.UpdateActionListener
    must be an instance of
    com.sun.facelets.tag.TagHandler
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.createClass
    (TagLibraryConfig.java:280)
    at
    com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.endElement
    (TagLibraryConfig.java:205)
    ... 68 more




    On 2/22/07, Jeff Bischoff <
    jbischoff@klkurz.com>
    wrote:
    I recommend t:updateActionListener. See [1]

    [1]
    http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters
    Regards,

    Jeff Bischoff
    Kenneth L Kurz & Associates, Inc.

    Mick Knutson wrote:
    I have the following:
    <h:commandLink
    action="userByUsername"
    onclick="open_alert();">
    <h:outputText
    value="#{ user.username}"/>
    </h:commandLink>

    But I need the command to be the action to
    be
    something like
    userByUsername?username=#{ user.username}
    to
    fire
    an
    event
    for my
    navigation
    rule "userByUsername" and sending a
    parameter
    http://www.myspace.com/djmick_dot_com
    http://www.myspace.com/djmick_dot_com


    --

    ---
    Thanks,
    Mick Knutson

    http://www.baselogic.com
    http://www.blincmagazine.com
    http://www.djmick.com
    http://www.myspace.com/djmick_dot_com
    http://www.thumpradio.com
    ---
  • Mick Knutson at Feb 28, 2007 at 12:19 am
    You where right, I missed that on the updateUser.xhtml so I added it:

    <ui:composition template="/WEB-INF/layout/layout.xhtml">
    <ui:define name="title">
    <h:outputText value="Update #{messages['default.title']}"/>
    </ui:define>
    <ui:define name="content">
    <t:saveState
    id="user"
    value="#{userBackingBean.user}" />
    <!--<h:form
    id="userBackingBean">-->
    <table width="100%" border="0" cellspacing="2" cellpadding="1">


    I also took that form off like you said and put it into the layout.

    Basically, it seems like UserBackingBeanImpl() is getting reinitialized
    again and nulling out the user, thus giving me a null updateUser Form.




    On 2/27/07, Mike Kienenberger wrote:

    The problem is that you deleted the

    <t:saveState
    id="user"
    value="#{userBackingBean.user}" />

    component that was preserving the value of user.
    in your user detail page, not in your user list page.
    On 2/27/07, Mike Kienenberger wrote:
    Mick,

    Instead of just dumping output, you need to describe what incorrect
    behavior you're seeing, and what you expect to see differently.

    In this particular case, I can guess what the problem is and why, but
    no one else would be able to do so.

    The problem is that you deleted the

    <t:saveState
    id="user"
    value="#{userBackingBean.user}" />

    component that was preserving the value of user.

    On 2/27/07, Mick Knutson wrote:
    Ok, I got the List thing changed. But this still seems odd:


    15:09:14,761 INFO [STDOUT] 15:09:14,761 INFO [UserBackingBeanImpl]
    UserBackingBean.prepareForEdit(String)
    15:09:14,761 INFO [STDOUT] 15:09:14,761 INFO [UserBackingBeanImpl]
    UserBackingBean.user.username(): mknutson
    .....

    15:09:14,792 INFO [STDOUT] 15:09:14,792 INFO [UserBackingBeanImpl]
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    15:09:14,823 INFO [STDOUT] 15:09:14,823 INFO [UserBackingBeanImpl]
    UserBackingBean.prepareForEdit(String).user.toString():
    com.baselogic.tro.user.User@93912f
    [username=mknutson,password=[protected]
    ,roles=[com.baselogic.tro.user.Role$$EnhancerByCGLIB$$1d73392c@847c91
    [name=<null>,description=<null>]],accountExpired=true,accountLocked=true,credentialsEx
    pired=true,enabled=true,confirmPassword=<null>,firstName=Mick,email=
    mknutson@baselogic.com,lastName=Knutson,address=2875-F
    Northtowne Lane,address2=#374,ci
    ty=Reno,state=NV,otherState=<null>,postalCode=94110,country=us,cardholder=<null>,card=<null>,expMonth=<null>,expYear=<null>,cvv2=<null>,schedule=<null>,las
    tUpdate=2007-02-21 13:03:35.0,creationDate=2006-11-01 18:24:02.0]
    15:09:14,823 INFO [STDOUT] 15:09:14,823 INFO [UserBackingBeanImpl]
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG [FacesServlet] service
    end
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG
    [ExceptionTranslationFilter]
    Chain processed normally
    15:09:14,823 INFO [STDOUT] 15:09:14,823 DEBUG
    [HttpSessionContextIntegrationFilter] SecurityContextHolder
    set to new context, as request processing comple
    ted
    15:09:14,839 INFO [STDOUT] 15:09:14,839 DEBUG
    [PathBasedFilterInvocationDefinitionMap] Converted URL to
    lowercase, from: '/views/admin/updateuser.jsf'; to
    : '/views/admin/updateuser.jsf'


    ....

    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userBackingBean' in via original
    VariableResolv
    er
    15:09:14,995 INFO [STDOUT] 15:09:14,995 INFO [UserBackingBeanImpl]
    UserBackingBeanImpl()
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userManager' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userManager' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userDao' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Successfully resolved variable 'userDao' in root WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DefaultListableBeanFactory]
    Returning cached instance of singleton bean 'userDao'
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in via original
    VariableResolver
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in root
    WebApplicationContext
    15:09:14,995 INFO [STDOUT] 15:09:14,995 DEBUG
    [DelegatingVariableResolver]
    Could not resolve variable 'userList'
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userList' in root
    WebApplicationContext
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG
    [DelegatingVariableResolver]
    Could not resolve variable 'userList'
    15:09:15,011 INFO [STDOUT] 15:09:15,011 DEBUG
    [DelegatingVariableResolver]
    Attempting to resolve variable 'userBackingBean' in via original
    VariableResolv
    er

    ....

    15:09:15,042 INFO [STDOUT] 15:09:15,042 ERROR [HtmlRendererUtils]
    Error
    finding Converter for component with id
    masterForm:userBackingBean:country
    javax.faces.el.PropertyNotFoundException:
    /views/admin/updateUser.xhtml @223,73 value="#{
    userBackingBean.user.country}": Target Unreachable, 'user' returne
    d null
    at com.sun.facelets.el.LegacyValueBinding.getType
    (LegacyValueBinding.java:96)
    at
    org.apache.myfaces.shared_tomahawk.renderkit._SharedRendererUtils.findUIOutputConverter
    (_SharedRendererUtils.java:58)
    at
    org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.findUIOutputConverter
    (RendererUtils.java:310)
    at
    org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRendererUtils.findUIOutputConverterFailSafe
    (HtmlRendererUtils.java:367)
    at
    org.apache.myfaces.custom.selectOneCountry.SelectOneCountryRenderer.encodeEnd
    (SelectOneCountryRenderer.java:73)
    at
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java
    :539)








    On 2/27/07, Mike Kienenberger wrote:
    Mick,

    What I sent you is files from a working example :-)

    Not sure why you're having issues, but you can certainly fetch the
    users as a List rather than a DataModel. In two years of working
    with
    JSF, I've never needed to use DataModel.

    One possible issue is that my example has the form in the layout
    template, not in each page. Perhaps you didn't notice that, and no
    longer have a form on the page?

    On 2/27/07, Mick Knutson wrote:
    I updated what you sent, and have some issues still.

    1. I tried using the List users; but the form did you come up at
    all. So
    I
    changed it to:
    public ListDataModel getUsers();


    Then when I did that, I get this error:


    java.lang.IllegalArgumentException: Link is not
    embedded in
    a form. Change component/tag '_id2:0:userpk' from
    javax.faces.*/<h:tagName
    /> to org.apache.myf
    aces.*/<t:tagName />, or embed it in a form. This is not a bug.
    Please
    see:
    http://wiki.apache.org/myfaces/Upgrading_to_Tomahawk_1.1.3
    The path to this co
    mponent is {Component-Path : [Class:
    javax.faces.component.UIViewRoot,ViewId:
    /views/admin/users.xhtml][Class:
    org.apache.myfaces.component.html.ext.HtmlDa
    taTable,Id: _id2][Class: javax.faces.component.UIColumn,Id:
    _id3][Class:
    javax.faces.component.html.HtmlCommandLink,Id:
    userpk]}. If
    you need to render a s
    pecial form and a JSF-form's attributes are not enough,consider
    using
    the
    s:form tag of the MyFaces sandbox.






    On 2/26/07, Mike Kienenberger wrote:
    Not sure why this bounced as spam. Maybe it was the zip
    attachment.
    Trying the pieces as individuals.

    ---------- Forwarded message ----------
    From: Mike Kienenberger < mkienenb@gmail.com>
    Date: Feb 26, 2007 11:56 PM
    Subject: Re: t:datatable with commandLink and parameter
    To: MyFaces Discussion < users@myfaces.apache.org>
    Cc: mickknutson@gmail.com


    Here's an example showing what you want.

    I tried to preserve all of the various things you were trying to
    demonstrate while deleting the unnecessary parts :-)

    Here's some of the bigger issues:

    - You were setting the username rather than the user on the
    detail
    page.
    - You were using t:saveState on your table page's user object.
    Thus,
    you'd set the user/username, and then promptly lose it when the
    table
    page overwrote the value back to null.
    - You were trying to saveState the value of users (the list of
    users)
    on the table page, but in reality, this was a constant function
    call,
    not a settable value. I demonstrated one possible way to do
    this,
    but there are many.

    Some minor things:
    - You don't need to mess with ListDataModel. Just return a list
    of
    your
    items.
    - You were initializing the value of user. Just leave it null.

    Best practices:
    - Stick a single form in your template. Use sandbox:subForm if
    you
    want to have virtual forms on each content page.

    I assume you're using prepareForEdit to fetch or create a
    mutable
    version of the user. If that's not the case, simply change
    your
    button to action="<Constants.EDIT>" instead of action="#{
    bean.method}"
    since you don't need to execute any java code. Note that I
    changed
    this to user = manager.getUser(user) instead of
    getUser(username) in
    order to keep the example simple. If you don't plan on editing
    the
    user directly, I'd dump the "user" variable, and save the
    username of
    the selected user instead.

    <t:updateActionListener<