Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-414

HttpServletRequest (and others) injection not working in servlet filters from web.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.5
    • 0.6
    • Servlet-Module
    • None

    Description

      DeltaSpike uses a filter to record the request and response objects for injection in that thread. This filter is configured in web-fragment.xml, which is loaded before other web-fragments, but not before web.xml. Filters from web.xml will be first in the chain, breaking request and response injection into these filters with "Attempt to access the request/response without an active HTTP request" (RequestResponseHolder:85).

      We are moving from Solder, where the request and response objects were recorded in a ServletRequestListener, which is always fired first, regardless of it's position in the web.xml/web-fragment.xml. I think DeltaSpike should use the same approach.

      For now, a workaround is to copy the configuration of RequestResponseHolderFilter to your web.xml and put it before all other filters.

      Attachments

        Activity

          People

            chkal Christian Kaltepoth
            papegaaij Emond Papegaaij
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: