0 Replies Latest reply on Aug 29, 2007 3:16 PM by Tandeep Sidhu

    Parse Error with Ajax4jsf and Trinidad

    Tandeep Sidhu Newbie

      Hi,

      I am getting an Parse error with a simple ajax4jsf enabled application.
      When I select an item from the combobox in a jsf page, it sends an ajax request, but the response is not valid. The input tag in the response is not closed by so the parser throws an exception. I believe this to be an issue with Trinidad's render that doesn't close some tags.

      I wonder if anyone had a similar situation and if you did, could you point me to the solution. Thanks.

      Details:


      Libraries Details:
      Tomcat 5
      JSF1.1
      Trinidad:1.1_01
      Ajax4jsf:1.1.1


      Error with ajax4jsf logging enabled

      debug[14:47:24,359]: Full response content: <?xml version="1.0"?>
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head><title>repeater</title><script type="text/javascript"
      
      src="/Organizations2/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript.jsf"> </script></head><body><select id="_id0:test" name="_id0:test"
      
      size="1"><option value="m2m2">m2m2</option><option value="m2m2m2">m2m2m2</option></select><meta
      
      name="Ajax-Update-Ids" content="_id0:test" /><span id="ajax-update-ids"><input type="hidden" name="jsf_sequence" value="1" /><input type="hidden"
      
      name="org.apache.myfaces.trinidad.faces.STATE" value="!_id1:_id4"></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
      
      error[14:47:24,359]: Error parsing XML
      error[14:47:24,359]: Parse Error: XML Parsing Error: mismatched tag. Expected: </input>. Location:
      
      http://localhost:8080/Organizations2/enrollments/AjaxTest1.jsf Line Number 3, Column 373: </script></head><body><select id="_id0:test" name="_id0:test" size="1"><option
      
      value="m2m2">m2m2</option><option value="m2m2m2">m2m2m2</option></select><meta name="Ajax-Update-Ids" content="_id0:test" /><span
      
      id="ajax-update-ids"><input type="hidden" name="jsf_sequence" value="1" /><input type="hidden" name="org.apache.myfaces.trinidad.faces.STATE"
      
      value="!_id1:_id4"></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
      
      




      JSF Page:

      
      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <html>
       <head>
       <title>repeater</title>
       </head>
       <body>
       <f:view>
       <h:form>
       <h:messages/>
      
       <h:selectOneMenu value="#{bean.sitem}" >
       <f:selectItem itemLabel="m1" itemValue="m1" />
       <f:selectItem itemLabel="m2" itemValue="m2" />
       <f:selectItem itemLabel="m3" itemValue="m3" />
       <a4j:support event="onchange" action="#{bean.delete}" reRender="test" ></a4j:support>
      
       </h:selectOneMenu>
      
       <h:selectOneMenu id="test">
       <f:selectItems value="#{bean.items}"/>
       </h:selectOneMenu>
      
       <a4j:status startText="start" stopText="end"></a4j:status>
       </h:form>
       <a4j:log popup="false"></a4j:log>
       </f:view>
       </body>
      </html>
      


      web.xml:

      
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      
      
       <context-param>
       <param-name>javax.faces.CONFIG_FILES</param-name>
       <param-value>/WEB-INF/faces-config.xml</param-value>
       </context-param>
      
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.jsf</url-pattern>
       </servlet-mapping>
      
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.jspx</url-pattern>
       </servlet-mapping>
      
       <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
       </welcome-file-list>
      
       <listener>
       <listener-class>
       com.sun.faces.config.ConfigureListener
       </listener-class>
       </listener>
      
      
      
       <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       <init-param>
       <param-name>forceparser</param-name>
       <param-value>false</param-value>
       </init-param>
       </filter>
      
       <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <url-pattern>*.jsf</url-pattern><!--
       <servlet-name>Faces Servlet</servlet-name>
       --><dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
      
       </filter-mapping>
      
      
      
      
       <filter>
       <filter-name>trinidad</filter-name>
       <filter-class>
       org.apache.myfaces.trinidad.webapp.TrinidadFilter
       </filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>trinidad</filter-name>
       <!-- This assumes that the FacesServlet has been registered -->
       <!-- under the name "faces" --><!--
       <servlet-name>Faces Servlet</servlet-name>
       --><url-pattern>*.jsf</url-pattern>
       </filter-mapping>
      
      
      
      
       <servlet>
       <servlet-name>resources</servlet-name>
       <servlet-class>
       org.apache.myfaces.trinidad.webapp.ResourceServlet
       </servlet-class>
       </servlet>
       <servlet>
       <description>
       This is the description of my J2EE component
       </description>
       <display-name>
       This is the display name of my J2EE component
       </display-name>
       <servlet-name>ErrorHandler</servlet-name>
       <servlet-class>
       edu.umd.elms.errorhandler.ErrorHandlerServlet
       </servlet-class>
       </servlet>
      
      
       <!-- This cannot be configured currently -->
       <servlet-mapping>
       <servlet-name>resources</servlet-name>
       <url-pattern>/adf/*</url-pattern>
       </servlet-mapping>
       <servlet-mapping>
       <servlet-name>ErrorHandler</servlet-name>
       <url-pattern>/servlet/ErrorHandler</url-pattern>
       </servlet-mapping>
      
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>server</param-value>
       </context-param>
      
      
      
      </web-app>