tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Istvan Devai <>
Subject proper context usage
Date Sat, 04 May 2013 16:15:25 GMT
Hi all,

My problem is, that I'd like to configure a valve for only one deployed 
application (deployed as a .war file)

Here are the ways I've already tried:

- Putting the <Context> element into server.xml. This works, however, 
after doing this, the manager application won't let me redeploy the 
application (gives an error message describing this).
- Putting the valve declaration into conf/context.xml. This also works, 
however, this way the valve configured for all deployed applications, 
which is not possible in my case (the valve is doing authentication 
stuff, which I do not want to take effect for other apps, eg the manager 
- Putting the valve declaration into conf/Catalina/localhost/myapp.xml. 
This also works fine, however this file is always deleted after 
redeployment (as far as I know, this was introduced to tomcat 7, as 
autoDeploy=false does not disable the deletion of context files). The 
official solution to this, - according to the manual - is to put the 
context.xml file into the .war file itself. However, the problem with 
this, is that the context contains database connections, mail sessions, 
etc. that are different for every environment where the .war file is 
deployed. That's why I'd like to stick with an external way of 

- Any idea how to have an external, application specific (that is, 
non-shared) context file that is not deleted on redeployment in the manager?
- Or maybe deploy the app in a different way that retains the 
app-specific context file?
- Any other solution to my problem in general?

I'm using Linux and Tomcat 7.0.37.

Kind regards,

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

View raw message