Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-12693

Mojarra fails to encode form inputs correctly when they doesn't have name attribute

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.3.0.M3
    • Fix Version/s: 4.3.0.CR1
    • Component/s: component-a4j-core
    • Labels:
      None
    • Environment:

      JBoss 7.1.1 with the stock "jsf-impl-2.1.7-jbossorg-2.jar" or upgraded to "jsf-impl-2.1.15.jar"

    • Sprint:
      4.3.0.CR1 - Bug fixes
    • Steps to Reproduce:
      Hide

      On IE7 with JBoss 7.1.1 use the following code to submit a query.

      <!DOCTYPE html>
      <html lang="en" 
      xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:a4j="http://richfaces.org/a4j">
      <h:head>
      </h:head>
      <h:body>
      	<h:form id="example">
      		<a4j:commandButton type="submit" value="Submit" />
      		<button>button</button>
      	</h:form>
      </h:body>
      </html>
      

      Show
      On IE7 with JBoss 7.1.1 use the following code to submit a query. <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j"> <h:head> </h:head> <h:body> <h:form id="example"> <a4j:commandButton type="submit" value="Submit" /> <button>button</button> </h:form> </h:body> </html>
    • Workaround Description:
      Hide

      Seems that adding a name="x" attribute to the button prevents the exception.

      Show
      Seems that adding a name="x" attribute to the button prevents the exception.

      Description

      When using the Richfaces a4j:commandButton I get the following stack trace when using Internet Explorer 7. This problem does not occur in IE8+ or Chrome.

      15:19:57,630 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception: java.lang.NullPointerException
      at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:441) [jsf-impl-2.1.15.jar:2.1.15]
      at com.sun.faces.context.PartialViewContextImpl.access$300(PartialViewContextImpl.java:71) [jsf-impl-2.1.15.jar:2.1.15]
      at com.sun.faces.context.PartialViewContextImpl$DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:582) [jsf-impl-2.1.15.jar:2.1.15]
      at javax.faces.context.PartialResponseWriter.startDocument(PartialResponseWriter.java:115) [jsf-api-2.1.15.jar:2.1]
      at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:199) [jsf-impl-2.1.15.jar:2.1.15]
      at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:124) [jsf-impl-2.1.15.jar:2.1.15]
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119) [jsf-impl-2.1.15.jar:2.1.15]
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116) [jsf-impl-2.1.15.jar:2.1.15]
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.15.jar:2.1.15]
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jsf-api-2.1.15.jar:2.1]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
      at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_20]
      

      I was surprised that this was only an IE7 issue, but I did find that PrimeFaces ran into a similar problem (http://code.google.com/p/primefaces/issues/detail?id=4361).

      Is there a workaround for this? Is this a Mojarra, RichFaces, or JBoss issue?

      I created http://java.net/jira/browse/JAVASERVERFACES-2666 in case this is a Mojarra problem, maybe we could help them resolve the issue.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                lfryc Lukáš Fryč (Inactive)
                Reporter:
                JustinKSU Justin Rosenberg
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 15 minutes
                  15m
                  Remaining:
                  Remaining Estimate - 15 minutes
                  15m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified