isComponentOnAjaxResponse() chokes on multiline AJAX response
-------------------------------------------------------------

                 Key: WICKET-862
                 URL: https://issues.apache.org/jira/browse/WICKET-862
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.0-beta2
            Reporter: Kent Tong


In isComponentOnAjaxResponse() in BaseWicketTester, the dot in the regular 
expression won't match newline characters and thus will fail:

        public Result isComponentOnAjaxResponse(Component component)
        {
                ...
                boolean isComponentInAjaxResponse = 
ajaxResponse.matches(".*<component id=\"" + markupId
                                + "\" ?>.*");
                ...
        }

Suggest changing it to:

        public Result isComponentOnAjaxResponse(Component component)
        {
                ...
                boolean isComponentInAjaxResponse = 
ajaxResponse.matches("(?s).*<component id=\"" + markupId
                                + "\" ?>.*");
                ...
        }

BTW I found this error when trying to update a feedback panel whose markup 
spreads across lines.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to