Re: 404 rewrite handler for images

Splash Forums Rewrite Users 404 rewrite handler for images Re: 404 rewrite handler for images


Hey Aaron,

I think something like this should be easy to do with Rewrite. The following example shows how something like this *could* work in a plain Servlet environment (without JSF resource loading):

.when(new HttpCondition() {
public boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context)
if(Direction.isInbound().evaluate(event, context)) {

String path = event.getRequestPath();
InputStream stream = event.getRequest().getServletContext().getResourceAsStream(path);
if(stream == null) {
return true;

return false;

But if you are using the JSF resource loading, checking whether a resource exists would work a bit different.