tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier (tomcat)>
Subject Re: httpd 2.2 +mod-jk1.2.37+ tomcat 7.0.28 (debian package)
Date Wed, 21 Oct 2015 17:47:51 GMT
On 20.10.2015 00:13, J Lopez wrote:
> Hi all,
>    is it possible to filter 404 application errors taking into account
> content-type beside http return code in jk configuration.
>    I need to difference between application is not deployed/executing (http
> 404 content-type html) and application running and returning a 404 json
> response (content-type json)
>    I have put mod-jk in debug mode and content-type is showed in logs. I
> have not seen in documentation if a fail_on_status can be combined with
> content-type returned.

I have not seen this in the documentation either, and it does not look like this feature 
is available.

But if I understand correctly, you have 2 cases of 404 :

1) if the application is for Tomcat "not there" (meaning for example it is not deployed at

that particular moment), then Tomcat itself returns a 404.
2) if the application is there and working, in some cases it returns a 404 itself.

And for some reason, you want to distinguish these 2 cases.

(It would help to know why, and at what level you want to distinguish this)

But let's suppose that the application is normally installed at (tomcat)/webapps/app1, and

responds to URLs like "/app1/*".

If the "/webapps/app1" application is not there, then Tomcat will try to map this to the 
default application, "/webapps/ROOT/app1/*".  Then it will probably not find it there 
either, and return a 404 response.

If the application is there, then Tomcat will (succesfully) map the call to 
/webapps/app1/*", and the application will respond. And, maybe, it will sometimes respond

with a 404.

So two possible solutions :
1) change the application, so that in such a case, it responds with something else than 404.
2) install something in /ROOT, which will catch everything that gets there, and respond 
with something else than 404.
That supposes of course that you do not previously have a default application under 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message