Beehive
  1. Beehive
  2. BEEHIVE-949

netui compiler does not encode strings in validation config files

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0
    • Component/s: NetUI
    • Labels:
      None
    • Environment:
      Windows XP. RC1 distribution from the v1/final branch.

      Description

      I am getting a runtime exception that looks like a malformed validation config file is being generated. Here is the snippet of the generated config file that looks problematic.
      <form-validation>
      <formset>
      <form name="listGroupForm">
      <field depends="mask,required" property="groupName">
      <arg0 key="groupNameRequired.displayName" resource="true"/>
      <var>
      <var-name>mask</var-name>
      <var-value>^[^' "=,\\<>#|&~?(){}%*]*$</var-value>
      </var>
      ....

      A snippet from the matching controller for this is:
      @Jpf.ValidatableBean
      ....
      validateMask = @Jpf.ValidateMask(regex="^[^' \"=,\\\\<>#|&~?(){}%*]*$")

      And the stack trace(s) I am seeing are:
      [exec] [ERROR] Digester - Parse Fatal Error at line 11 column 33: The content of elements must consist of well-formed character data or markup. <org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.>org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

      [exec] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
      [exec] at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
      [exec] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
      [exec] at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
      [exec] at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438)
      [exec] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1723)
      [exec] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
      [exec] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
      [exec] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
      [exec] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
      [exec] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
      [exec] at org.apache.commons.digester.Digester.parse(Digester.java:1591)
      [exec] at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:159)
      [exec] at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
      [exec] at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
      [exec] at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
      [exec] at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.registerModule(AutoRegisterActionServlet.java:553)
      [exec] at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.ensureModuleRegistered(AutoRegisterActionServlet.java:770)
      [exec] at org.apache.beehive.netui.pageflow.FlowControllerFactory.ensureModule(FlowControllerFactory.java:736)
      [exec] at org.apache.beehive.netui.pageflow.FlowControllerFactory.createPageFlow(FlowControllerFactory.java:209)
      [exec] at org.apache.beehive.netui.pageflow.FlowControllerFactory.createPageFlow(FlowControllerFactory.java:183)

      [exec] [ERROR] ValidatorPlugIn - Skipping all validation <org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.>org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
      [exec] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1269)
      [exec] at org.apache.commons.digester.Digester.parse(Digester.java:1591)
      [exec] at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:159)
      [exec] at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
      [exec] at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
      [exec] at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
      [exec] at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.registerModule(AutoRegisterActionServlet.java:553)
      [exec] at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.ensureModuleRegistered(AutoRegisterActionServlet.java:770)
      [exec] at org.apache.beehive.netui.pageflow.FlowControllerFactory.ensureModule(FlowControllerFactory.java:736)
      [exec] at org.apache.beehive.netui.pageflow.FlowControllerFactory.createPageFlow(FlowControllerFactory.java:209)
      [exec] at org.apache.beehive.netui.pageflow.FlowControllerFactory.createPageFlow(FlowControllerFactory.java:183)

      1. j949-patch.txt
        60 kB
        Rich Feit
      2. j949-patch-code-only.txt
        3 kB
        Rich Feit

        Activity

          People

          • Assignee:
            Alejandro Ramirez
            Reporter:
            Jim Cummings
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development