-
Type:
New Feature
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: facesbridge-api-5.0.0, facesbridge-tck-5.0.0, facesbridge-spec-5.0.0, bridge-impl-5.0.0
-
Labels:None
The ExternalContext.setResponseStatus(int statusCode) method was added in JSF 2.0.
The FacesBridge must follow the requirements in the JSF 2.2 JavaDoc. However, in a portlet environment it is only possible to set the response status during the RESOURCE_PHASE of the portlet lifecycle. Because of this, the FacesBridge will only be required to set the status code during the RESOURCE_PHASE. Rather than calling HttpServletResponse.setStatus(int statusCode), the FacesBridge must call the new Portlet 3.0 ResourceResponse.setStatus(int statusCode) method. In all other phases of the portlet lifecycle, calling ExternalContext.setResponseStatus(int statusCode) is a no-op for the FacesBridge.
TCK: setResponseStatusTest (bridge-tck-main-portlet)
- Dispatch an XHR that targets the ResourceURL for a known cacheable image resource such as "#{resource[myValidLibrary:myValidImage]}" and verify that the status code is HttpServletResponse.SC_OK (200).
- Dispatch an XHR that targets the ResourceURL for the same cacheable image resource such as "#{resource[myValidLibrary:myValidImage]}" and verify that the status code is HttpServletResponse.NOT_MODIFIED (304).
- Dispatch an XHR that targets the ResourceURL for a missing image resource such as "#{resource[myInvalidLibrary:myValidImage]}" and verify that the status code is HttpServletResponse.SC_NOT_FOUND (404).
- Dispatch an XHR that targets the ResourceURL for a missing image resource such as "#{resource[myValidLibrary:myInvalidImage]}" and verify that the status code is HttpServletResponse.SC_NOT_FOUND (404).
- Dispatch an XHR that targets the ResourceURL for a banned path such as "/WEB-INF" and verify that the status code is HttpServletResponse.SC_NOT_FOUND (404).
- Dispatch an XHR that targets the ResourceURL for a banned character sequence such as "../../" and verify that the status code is HttpServletResponse.SC_NOT_FOUND (404).
- Dispatch an XHR that targets the ResourceURL for a facelet document such as "myView.xhtml" and verify that the status code is HttpServletResponse.SC_NOT_FOUND (404).
Note that additional TCK test assertions may need to be added as the FacesBridge ResourceHandler security requirements are fully established.
- is duplicated by
-
FACES-3301 Add BridgeStatusErrorException to allow custom JSF ExceptionHandlers to handle different HTTP error status code
-
- Closed
-