English 中文(简体)
Tomcat´s server.xml dynamic configuration
原标题:

My web application uses the same database configuration as the application XYZ. I have a resource declaration for a context in server.xml, so I have a duplicated configuration (once for web application and once for application XYZ). How can I read some external values into server.xml? For example:

<Resource name="jdbc/MyDB" username="${user}" password="${pwd}" url="${url}" ...
最佳回答

In short - you can t do this with tomcat configuration. Also, specific for server.xml, the only way to reload it is to restart the server.

If you need the datasource only within one web application, then a way to do it is by using the spring framework and PropertyPlaceholderConfigurer.

Another way might be to inherit from tomcat s StandardHost and StandardContext and do some custom parsing.

问题回答

暂无回答




相关问题
Tomcat´s server.xml dynamic configuration

My web application uses the same database configuration as the application XYZ. I have a resource declaration for a context in server.xml, so I have a duplicated configuration (once for web ...

session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

JSP exception - class not found (tomcat)

I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...

热门标签