Accessing web.xml Metadata from Tomcat

From NovaOrdis Knowledge Base
Revision as of 18:40, 27 February 2017 by Ovidiu (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

<security-constraint>

web.xml <security-constraint> metadata is represented by org.apache.catalina.deploy.LoginConfig.

It can be accessed as follows (the code comes from org.apache.catalina.authenticator.AuthenticatorBase).

LoginConfig lc = contex.getLoginConfig();

<login-config>

web.xml <login-config> metadata is represented by org.apache.catalina.deploy.SecurityConstraint.

It can be accessed as follows (the code comes from org.apache.catalina.authenticator.AuthenticatorBase).

Realm realm = this.context.getRealm()
SecurityConstraint [] constraints = realm.findSecurityConstraints(request, this.context);