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

numeric character reference being unescaped (Maybe in TidyParser?)

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Numeric character reference are being resolved and the character they represent is being sent to the client instead of Numeric Character reference.
      With the parser turned off for regular requests, the following code works correctly on the first render but fails on the ajax update
      [web.xml]
      ...
      <filter>
      <display-name>RichFaces Filter</display-name>
      <filter-name>richfaces</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>
      <!-- Only filter on ajax request not every request http://javablog.be/java/fix-your-richfaces-ajax-performance-problems/-->
      <init-param>
      <param-name>forceparser</param-name>
      <param-value>false</param-value>
      </init-param>
      </filter>
      ...
      [END]
      [TEST PAGE]
      <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

      <f:view>
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
      <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
      <head>
      </head>
      <body>
      <h:form id="Frm1">
      <a4j:outputPanel id="panel">
      <t:outputText id="textOut" value="•" escape="false"/>
      <a4j:commandButton reRender="panel"/>
      </a4j:outputPanel>
      </h:form>
      </body>
      </html>
      </f:view>
      [END]
      [Network Trace for full request, response]
      ...
      <span id="Frm1:panel">
      <span id="Frm1:textOut">

      </span>
      <input id="Frm1:j_id_jsp_388183768_4" name="Frm1:j_id_jsp_388183768_4" onclick="A4J.AJAX.Submit('j_id_jsp_388183768_0','Frm1',event,{'parameters':

      {'Frm1:j_id_jsp_388183768_4':'Frm1:j_id_jsp_388183768_4'}

      ,'actionUrl':'/Coverzone/test/testAjax.jsf'} );return false;" type="button" />
      </span>
      ...
      [END]
      [Network Trace for Ajax response]
      ...
      <span id="Frm1:panel">
      <span id="Frm1:textOut">
      ?
      </span>
      <input id="Frm1:j_id_jsp_388183768_4" name="Frm1:j_id_jsp_388183768_4" onclick="A4J.AJAX.Submit('j_id_jsp_388183768_0','Frm1',event,{'parameters':

      {'Frm1:j_id_jsp_388183768_4':'Frm1:j_id_jsp_388183768_4'}

      ,'actionUrl':'/Coverzone/test/testAjax.jsf'} );return false;" type="button" />
      </span>
      ...
      [END]

      NOTE: the output of Frm1:textOut in first response is • in the ajax response this is the char(149).

        Gliffy Diagrams

          Attachments

          1. correct.png
            correct.png
            0.7 kB
          2. Correct Network Trace.png
            Correct Network Trace.png
            47 kB
          3. error.png
            error.png
            0.8 kB
          4. Error Network Trace.png
            Error Network Trace.png
            45 kB
          5. testAjax.jsp
            1 kB

            Activity

              People

              • Assignee:
                nbelaevski Nick Belaevski
                Reporter:
                dwat001 David Waters
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: