我正在为后端开发带有 spring 的 struts2 应用程序。
我们正在使用 database.properties 文件,条目如下:
jdbc.url=jdbc:mysql://localhost:3306/myDb
jdbc.username=root
jdbc.password=rooooot
jdbc.csvlocation=C:\myCSV
我在 database.properties 中添加了以下新条目
enhancePerf.Flag=true
在 applicationcontext.xml 我正在获取这样的值:-
<bean id="userLogin" scope="prototype"
class="com.hello.something.actions.UserLoginAction">
<property name="perfEnhance" value="${enhancePerf.Flag}"/>
</bean>
在 UserLoginAction 中声明一个全局变量 perfEnhance 并形成相同的 setter 和 getters 方法后,我仍然没有得到值。
我点击了以下链接:-
http://www.roseindia.net/tutorial/spring/spring3/web/applicationcontext.xml-properties-file.html
请指教。