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

SharedResourceRequestTarget sets Status 404 when not found, ignoring any 404 settings

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.3
    • 1.4.7
    • wicket
    • None

    Description

      In SharedResourceRequestTarget, Line 186, the code just sets the 404 status when the requested resource was not found which defeats all page not found settings and tomcat error settings:

      ((WebResponse)response).getHttpServletResponse().setStatus(
      HttpServletResponse.SC_NOT_FOUND);

      We've got in Application:

      mountBookmarkablePage("/error/notfound", NotFoundErrorPage.class);

      And in the app's web.xml:

      <error-page>
      <error-code>404</error-code>
      <location>/error/notfound</location>
      </error-page>

      This works for other cases, but not for this. Probably instead of setStatus a sendError or something like that should be done?

      Ways to reproduce:

      Create an error page and mount it like shown above. Also add the error-page entry to the web.xml
      Now try to access http://host/app/resources/x.y.z (thus requesting the resource x.y.z)
      What happens: The ugly default tomcat error page is displayed
      What should have happened: The page configured as 404 page should be displayed

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            tapter Matthias Keller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: