设有welcome={0}\u6b22\u8fce\u6765\u5230\u6210\u90fd{1}这样的国际化信息,那么如何输出jsp页面和action中的占位符信息?
在jsp页面只要设置参数即可:
<s:text name="welcome">
<s:param>小周</s:param> //{0}
<s:param>study</s:param> //{1}
</s:text>
action中又如何设置占位符信息:
@Override
public String execute() throws Exception {
ActionContext.getContext().put("message", this.getText("welcome",new String []{"小周","study"}));
return "message";
}