如何以编程方式从.properties文件中获取Struts2值? [英] How do you get a Struts2 value from the .properties file programatically?

查看:79
本文介绍了如何以编程方式从.properties文件中获取Struts2值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有一个struts.properties文件,其中定义了一个值uploads.directory.如何从ActionContext中以编程方式访问该值?

Say I have a struts.properties file with a defined value uploads.directory . How can I access that value from an Actioncontext programatically?

推荐答案

您可以使用getText("some.property.name")来返回属性值

You can use getText("some.property.name") which return you the property value

http://struts.apache .org/maven/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html

这篇关于如何以编程方式从.properties文件中获取Struts2值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆