ICEfaces
  1. ICEfaces
  2. ICE-6891

PersistentFacesServlet returns a HTTP 200 code instead of returning the correct HTTP error status

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA_P02
    • Fix Version/s: EE-1.8.2.GA_P03
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      -

      Description

      In addition to ICE-6862 which was resolved in 1.8.2 P03, the customer has noticed that the PersistentFacesServlet also answers requests for URLs containing "/xmlhttp/*" and exhibits the same behavior in ICE-6682. For a fake URL (ex. ../xmlhttp/phpMyAdmin/debug.html) it first returns a blank page with an HTTP 200 and only on the second invocation returns HTTP 500.

        Activity

        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mircea Toma added a comment -

        The CachingControlledServer applies the caching procedures even when the wrapped server replies with a non-200 HTTP status code.

        The fix stops the caching of the responses that do not return 200 HTTP status code.

        Show
        Mircea Toma added a comment - The CachingControlledServer applies the caching procedures even when the wrapped server replies with a non-200 HTTP status code. The fix stops the caching of the responses that do not return 200 HTTP status code.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24751 Thu Jun 02 05:47:19 MDT 2011 jack.van.ooststroom ICE-6891 Stop caching of the responses that do not return 200 HTTP status code. (Commit done for Mircea)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/common/standard/CacheControlledServer.java
        Hide
        Mircea Toma added a comment -

        The fix applied restores the default view handler when an exception is caught while trying to serve an non JSF page.

        Show
        Mircea Toma added a comment - The fix applied restores the default view handler when an exception is caught while trying to serve an non JSF page.
        Hide
        Mircea Toma added a comment -

        When serving non-JSF pages during page load the default view handler is switched to a dispatching view handler. Also a reload command is sent back to the bridge. When the next request (for the same page) arrives the dispatch is made (for sending PDFs for example).
        So the 404 response is sent while using the default view handler, the 200 response is sent by the dispatching view handler set right after the previous response was committed.

        Show
        Mircea Toma added a comment - When serving non-JSF pages during page load the default view handler is switched to a dispatching view handler. Also a reload command is sent back to the bridge. When the next request (for the same page) arrives the dispatch is made (for sending PDFs for example). So the 404 response is sent while using the default view handler, the 200 response is sent by the dispatching view handler set right after the previous response was committed.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24745 Wed Jun 01 15:45:48 MDT 2011 mircea.toma ICE-6891 Restore default view handler while exception is caught while trying to serve an non JSF page.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeFacesContext.java
        Jack Van Ooststroom made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Jack Van Ooststroom added a comment -

        When keep hitting the bogus URL a couple of times it could still happen that a 200 OK is being received instead of the desired 404 Not Found. Reloading the bogus URL every second or so for about 10 times shows the 200 OK for me on occasion. Reopening this issue.

        Show
        Jack Van Ooststroom added a comment - When keep hitting the bogus URL a couple of times it could still happen that a 200 OK is being received instead of the desired 404 Not Found. Reloading the bogus URL every second or so for about 10 times shows the 200 OK for me on occasion. Reopening this issue.
        Mircea Toma made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mircea Toma added a comment -

        Introduced TemplateNotFound runtime exception that can bubble through without having JSF logging its stack trace. This avoids verbose messages being logged during requests for inexistent pages. The solution also avoids the statefull issue introduced by the previous fix where the server will alternate 200 and 404 responses for consecutive requests.

        Show
        Mircea Toma added a comment - Introduced TemplateNotFound runtime exception that can bubble through without having JSF logging its stack trace. This avoids verbose messages being logged during requests for inexistent pages. The solution also avoids the statefull issue introduced by the previous fix where the server will alternate 200 and 404 responses for consecutive requests.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24692 Wed May 25 14:18:29 MDT 2011 mircea.toma ICE-6891 Introduced TemplateNotFound runtime exception that can be bubble through without having JSF logging its stack trace.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/D2DViewHandler.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/View.java
        Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/TemplateNotFound.java
        Mircea Toma made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mircea Toma added a comment -

        Change D2DViewHandler to throw FileNotFoundException when the template corresponding to the requested URL cannot be found. The View code now captures the FileNotFoundException and respond with a HTTP 404 message.
        Also, the ResourceServer was modified to detect any request for resource that does not match a registered resource in order to respond with a HTTP 404 message.

        Show
        Mircea Toma added a comment - Change D2DViewHandler to throw FileNotFoundException when the template corresponding to the requested URL cannot be found. The View code now captures the FileNotFoundException and respond with a HTTP 404 message. Also, the ResourceServer was modified to detect any request for resource that does not match a registered resource in order to respond with a HTTP 404 message.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #24662 Mon May 23 07:25:46 MDT 2011 mircea.toma ICE-6891 Throw FileNotFoundException when the template corresponding to the requested URL cannot be found. Capture FileNotFoundException and respond with a HTTP 404 message. Detect any request for resources that does not match a registered resource to respond with a HTTP 404 message.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/D2DViewHandler.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/ResourceServer.java
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/View.java
        Ken Fyten made changes -
        Assignee Jack van Ooststroom [ jack.van.ooststroom ] Mircea Toma [ mircea.toma ]
        Ken Fyten made changes -
        Fix Version/s EE-1.8.2.GA_P03 [ 10251 ]
        Assignee Priority P1
        Tyler Johnson made changes -
        Assignee Jack van Ooststroom [ jack.van.ooststroom ]
        Tyler Johnson made changes -
        Field Original Value New Value
        Salesforce Case [5007000000GublN]
        Tyler Johnson created issue -

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: