Reputation: 160
I am trying to get a login page from within a Filter, like so: context.getRequestDispatcher("/loginpage.jsp") (Which I then want to forward to)
Now, if i do context.getContext("/loginpage.jsp"), it properly shows me the filesystem path to the resource I want. So that means it can indeed see it. However using request dispatcher it just wont resolve.
I am running this tomcat in a very non standard way. I am calling java.exe with all the properties and options that catalina.sh normally would call. I would agree that this could be the cause of all my problems, but I am still interested in finding out what could be breaking in here.
(Note: This runs like this only in dev environments and has been working properly without complains till recently. However I recently made major changes to the dev env, which apparently broke something)
EDIT: Another point I just noticed was, that even trying to access completely static resources (like /css/styles.css, etc) was failing. So it isnt a specific problem with getrequestDispatcher, but something more fundamental I presume?
Upvotes: 1
Views: 1407
Reputation: 160
The solution was really simple and down to a misunderstanding of how the CATALINA_HOME / CATALINA_BASE works: Anything placed in CATALINA_HOME/conf seems to be ignored. So even though I had web.xml and content.xml in the CATALINA_HOME/conf it ignored that.
There are no exceptions or errors in any of the logs (application logs, catalina.logs, localhost.log, host-managed.log, etc). So it is really hard to debug this problem.
This question helped me figure the answer out: https://serverfault.com/questions/205154/war-deployed-in-tomcat-not-showing-up-at-url-getting-404-instead
Upvotes: 1