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 /webapps/ROOT.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to