Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-7074

[AJAX] malformed XML is produced if an error is produced during AJAX rendering and a redirect is issued

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 10.0.0-M1, 9.15.0
    • 10.0.0-M2, 9.16.0
    • None
    • None

    Description

      In AjaxRequestHandler in case there are no filters defined AjaxUpdate written directly to response. See below

       

       

      // code placeholder
      
      if (filters == null || filters.isEmpty())
      {
          update.writeTo(response, encoding);
      }
      else
      {
          final StringResponse bodyResponse = new StringResponse();
          update.writeTo(bodyResponse, encoding);
          CharSequence filteredResponse = invokeResponseFilters(bodyResponse, filters);
          response.write(filteredResponse);
      } 

       

      In case a "dynamic" error is produced and we use exception mapper to redirect to an error page then generated response XML is of the form

       

      // code placeholder
      
      <?xml version="1.0" encoding="UTF-8"?><ajax-response><ajax-response><redirect><![CDATA[./internalError?4]]></redirect></ajax-response>

      which is malfomed and this causes redirect to be broken. 

       

      Attachments

        Activity

          People

            reiern70 Ernesto Reinaldo Barreiro
            reiern70 Ernesto Reinaldo Barreiro
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: