Since my question was related to JSF and 404 error throwing.
There is an answer I came up with:
Adding a setting to web.xml:
<context-param>
<param-name>facelets.RESOURCE_RESOLVER</param-name>
<param-value>our.company.CustomResourceResolver</param-value>
</context-param>
Where: CustomResourceResolver extends javax.faces.view.facelets.ResourceResolver
There I would have an overridden method:
@Override
public URL resolveUrl(String path) {
try {
String fixedPath = "/WEB-INF/pages";
return getResolvedPath(path, fixedPath);
} catch(IOException e) {
throw new FacesException(e);
}
}
Here we assuming that all our pages are located in /WEB-INF/pages
folder
Thus, Every time when exception happens it would interpreted as 404.
And: we should delete <security-constraint>
from web.xml
- this guy is good if we want to show user that he does not have access to particular resource, but in our case we do not want showing this. We don't want showing him the fact that this resource exits at all.