html_errors标签引入国际化资源包

public class UserForm extends ActionForm {
@Override
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
String name1 = user.getUsername();
if(name1 != null)
name1 = name1.trim();
if("".equals(name1))
errors.add("username", new ActionMessage("error.username"));
return errors;
}
}

.................
</action-mappings>
<message-resources parameter="cn.user.strutsdemo.application.Application"></message-resources>
[color=blue][b]<message-resources parameter="cn.user.strutsdemo.application.Application" key="XXX"></message-resources>
(jsp画面对应的这个资源包里显示形式为:
<title><bean:message key="info.title" bundle="XXX"/></title>)
<html:errors bundle="XXX" />
[/b][/color]</struts-config>

Application.properties里面中文以unicode码形式保存
Application_en.properties
Application_zh_CN.properties
Application.properties

画面<html:errors/>表示

<html>标签里面不可以再套标签(即标签里面属性值不能也是标签):
<html:submit><bean:message key='info.submit'/></html:submit>
但<input>标签中可以套标签使用:
<input type="submit" value="<bean:message key='info.submit'/>" />
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值