[struts]请问在validator中,如何调用非默认资源文件中的内容?

since2006 2005-10-30 02:05:16
假如默认的资源文件名为default.properties

<field property="name" depends="required">
<arg0 name="required" key="pm.name"/>
</field>

这样写,用户提交不合规则时,struts调用(default.properties)默认资源文件中的pm.name

假如我想要让使用specify.properties中的pm.name,该怎么做?

请指教。 ^___^
...全文
179 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jerome_liu 2005-11-16
  • 打赏
  • 举报
回复
Validator
Resource Bundle Support
The bundle attribute for the <msg> and <arg> elements in the Validator configuration file (e.g. validation.xml) are now supported along with the resource attribute on the <msg> element.

New pages have been added to the struts-examples webapp showing the new Resource Bundle Support and a page for validwhen examples.

1.2.7中的说明,已经支持
since2006 2005-10-30
  • 打赏
  • 举报
回复
在struts-config.xml中配置为:
<message-resources parameter="web.org.exblog.webapp.resource.ApplicationResources"/>

<message-resources parameter="web.org.exblog.webapp.resource.PersonnelManagerResource" key="pm"/>

像输出 <bean:message> 可以使用bunlde="pm"指定,在validator中该怎么作呢?

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧