2 Replies Latest reply on Oct 29, 2008 7:18 AM by lee shaotu

    a4j:jsFunction Exception in the filter chain

    lee shaotu Newbie

      Hi,
      there is a problem when i use a4j:jsFunction.
      page code:

      <h:form>
      <a4j:jsFunction name="updateNextView" reRender="nextView">
       <a4j:actionparam name="param1" assignTo="#{nav.nextView}"/>
      </a4j:jsFunction>
      <a4j:jsFunction name="rerendSelf" reRender="#{nav.rerendedComp}">
       <a4j:actionparam name="param2" assignTo="#{nav.rerendedComp}"/>
       </a4j:jsFunction>
      
      <a4j:jsFunction name="rerendBefore" reRender="#{nav.rerendedOldComp}"/>
      </h:from>
      ......
      <ui:composition>
       <h:panelGrid id="resourceNav">
       <h:outputLink value="javascript:;">
       <span class="#{nav.nextView=='resource_m_select'?'navTextActive':'navText'}"
       onmousemove="this.className='navTextActive'"
       onmouseout="this.className='#{nav.nextView=='resource_m_select'?'navTextActive':'navText'}'"
       onclick="updateNextView('resource_m_select'),rerendSelf('resourceNav'),rerendBefore()">manage<span>
       </h:outputLink>
      
       <h:outputLink value="javascript:;">
       <span class="#{nav.nextView=='resource_m_add'?'navTextActive':'navText'}"
       onmousemove="this.className='navTextActive'"
       onmouseout="this.className='#{nav.nextView=='resource_m_add'?'navTextActive':'navText'}'"
       onclick="updateNextView('resource_m_add'),rerendSelf('resourceNav'),rerendBefore()">add</span>
       </h:outputLink>
       </h:panelGrid>
      </ui:composition>


      It's like a navigation link list,being selected or not,the style are different.

      This Exception appears when first time click one of the link,then it will not appear.

      Exception code:
      20:30:35,269 ERROR [lifecycle] JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /workspace/admin.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@fe8c4]
      20:30:35,270 INFO [STDOUT] ERROR - Exception in the filter chain
      javax.servlet.ServletException: String index out of range: 0
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at edu.wanli.os.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:58)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
       at java.lang.String.charAt(String.java:687)
       at org.ajax4jsf.context.AjaxContextImpl.convertId(AjaxContextImpl.java:354)
       at org.ajax4jsf.context.AjaxContextImpl.addRegionsFromComponent(AjaxContextImpl.java:331)
       at org.ajax4jsf.component.AjaxActionComponent.setupReRender(AjaxActionComponent.java:96)
       at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:60)
       at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
       at org.ajax4jsf.component.AjaxViewRoot.broadcastAjaxEvents(AjaxViewRoot.java:340)
       at org.ajax4jsf.application.AjaxViewHandler.processAjaxEvents(AjaxViewHandler.java:230)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
       ... 27 more
      20:30:35,270 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      java.lang.StringIndexOutOfBoundsException: String index out of range: 0
       at java.lang.String.charAt(String.java:687)
       at org.ajax4jsf.context.AjaxContextImpl.convertId(AjaxContextImpl.java:354)
       at org.ajax4jsf.context.AjaxContextImpl.addRegionsFromComponent(AjaxContextImpl.java:331)
       at org.ajax4jsf.component.AjaxActionComponent.setupReRender(AjaxActionComponent.java:96)
       at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:60)
       at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
       at org.ajax4jsf.component.AjaxViewRoot.broadcastAjaxEvents(AjaxViewRoot.java:340)
       at org.ajax4jsf.application.AjaxViewHandler.processAjaxEvents(AjaxViewHandler.java:230)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at edu.wanli.os.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:58)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Thread.java:619)