Similar to Define a <security-constraint> outside of web.xml (e.g. server-wide), I am trying to define a security-constraint outside of my application's WEB-INF/web.xml. However, unlike that question, I don't want to define it server-wide. I have tried to put the security-constraints in both META-INF/context.xml
and ${catalina.home}/conf/Catalina/localhost/<myapp>.xml
. Adding the security-constraints to ${catalina.home}/conf/web.xml
works fine, but this does it for everything on the server, and I am trying to avoid this if possible.
I can't find any documentation that says definitively security-constraints must be defined in a web.xml
, but this seems to be the case. Is this true?