With your help I have successfully resolved a question that I have asked here. I have developed a custom Tomcat authenticator for the web application, and currently the authenticator and its configuration file are located in the %CATALINA_HOME%\lib\
directory. Unfortunately, the authenticator configuration file is almost a duplicate for the configuration file of the web application (located in %CATALINA_HOME%\webapps\myapp
) the authenticator was developed for, and the configuration files both, obviously, share the same DB-connection settings. This is inconvenient because sharing the only configuration file would be the best.
I think there could be two ways to resolve the issue:
- Find the
webapps
directory formyapp
presence somehow at Tomcat startup, and then read the application configuration file (proceed from the current situation, and themyapp\WEB-INF\web.xml
is configured properly). Sure, unfortunately this requires Tomcat restart. - There might be a way to put the form authenticator into the corresponding web application directory to be able to read the shared configuration file directly. Perhaps this might eliminate Tomcat restart and allow simple redeployment.
I would like to prefer the second solution if it's possible, but I'm not sure. Which way is better, if they both exist? Or is there any other and even better solution not putting the web application specific authenticator into %CATALINA_HOME\lib%
?
Thanks in advance and sorry for my English.
context.xml
configured to use that authenticator. The only problem is that the web application is webapps-directory-based and the authenticator is%CATALINA_HOME%\lib
-directory-base though the business logic of the authenticator depends on just that app. And it could be perfect if their configuration files were only and not a pair. The reason of the question is that deploying of the web app always requires updating the authenticator settings to become the same. The%CATALINA_HOME%\lib
is just "spoiled" with auth config file. – Lyubomyr Shaydariv