Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1941

Alerts component can fail with ComponentEventException is dismiss event triggered outside of XHR request (e.g., by web crawler)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3.3
    • Fix Version/s: 5.4
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      The Alerts component does not check for request.isXHR() in the "onDismiss" event handler.

      Crawlers (Googlebot) send non-xhr requests to the "onDismiss" event-url and generate errors on my server, because the returned JSONObject is not a valid return value from an event handler.

      org.apache.tapestry5.runtime.ComponentEventException: A component event handler method returned the value {}. Return type org.apache.tapestry5.json.JSONObject can not be handled.

      A check for request.isXHR() and a conditional return value (null for non-ajax requests, the json object for ajax requests) should fix this.

      thanks!

        Attachments

          Activity

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              felixgonschorek Felix Gonschorek
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: