Description
There is a cache for the calculated result whether the given request is a resource request.
I think it is not working as expected in the moment.
ResourceHandlerImpl:
@Override
public boolean isResourceRequest(FacesContext facesContext)
{
// Since this method could be called many times we save it
//on request map so the first time is calculated it remains
//alive until the end of the request
Boolean value = (Boolean) facesContext.getAttributes().get(IS_RESOURCE_REQUEST);
if (value != null && value)
{ //return the saved value return value; } else
{
String resourceBasePath = getResourceHandlerSupport()
.calculateResourceBasePath(facesContext);
if (resourceBasePath != null
&& resourceBasePath.startsWith(ResourceHandler.RESOURCE_IDENTIFIER))
else
{ facesContext.getAttributes().put(IS_RESOURCE_REQUEST, Boolean.FALSE); return false; } }
}
In case of IS_RESOURCE_REQUEST=false the value is recalculated for every method call again because of the 'if (value != null && value)'. I think it just should be 'if (value != null)', or?
(
@Override
public boolean isResourceRequest(FacesContext facesContext)
{
// Since this method could be called many times we save it
// on request map so the first time is calculated it remains
// alive until the end of the request
Boolean value = (Boolean) facesContext.getAttributes().get(IS_RESOURCE_REQUEST);
if (value == null)
{ String resourceBasePath = getResourceHandlerSupport() .calculateResourceBasePath(facesContext); value = resourceBasePath != null && resourceBasePath.startsWith(ResourceHandler.RESOURCE_IDENTIFIER); facesContext.getAttributes().put(IS_RESOURCE_REQUEST, value); } return value;
}
)