Hi all,
I have a web application of Struts2.2.1+spring2.5.6+hibernate3.3.1. The datasource is configured in applicationContext.xml like the following:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/db_ictboxm?useUnicode=true&characterEncoding=utf8" /> <property name="username" value="root" /> <property name="password" value="passw0rd" /> </bean>
It works fine after the WAR is deployed, but in the case that the datasource parameters are different from that in applicationContext.xml, the hostname, the username and password, for example, I need to edit the applicationContext.xml to change these three values manually, and then restart the container tomcat, finally access the website.
Is there a way that allows the deployer to reset the three values, not by editing the applicationContext.xml? can applicationContext.xml be read and saved by code? and do i must restart container tomcat after the applicationContext.xml is changed? how to solve this problem?
Lucy
|