[struts]HTML:MESSAGES和HTML:ERRORS用法简例
2008-06-01 20:10
232 查看
HTML:MESSAGES和HTML:ERRORS用法简例=======<html:messages>============
Action 中 :
ActionMessages message = new ActionMessages();
message.add(" 消息句柄 ",new ActionMessage(" 资源文件中 Key 值 ",String 类型描述信息 ));
this.addMessages(request,message);
return ActionForward;
JSP 页面中 :
<html:messages id=" 指定使用消息的标识 " property=" 消息句柄 " message="true|false">
<bean:write name=" 以上所指 ID 标识 "/>
</html:messages> ==========<html:errors>==============
Action 中 :
ActionMessages message = new ActionMessages();
message.add(" 消息句柄 ",new ActionMessage(" 资源文件中 Key 值 ",String 类型描述信息 ));
this.saveErrors(request,message);
return ActionForward;
JSP 页面中 :
<html:errors property=" 消息句柄 "/> 如果Action中这样设定(false),页面的提示信息将不从资源文件里读取:
ActionMessages message = new ActionMessages();
message.add("消息句柄",new ActionMessage("String类型描述信息));",false));
this.saveErrors(request,message);
return ActionForward;
JSP页面:
<html:errors/>或<html:errors property="消息句柄"/
Action 中 :
ActionMessages message = new ActionMessages();
message.add(" 消息句柄 ",new ActionMessage(" 资源文件中 Key 值 ",String 类型描述信息 ));
this.addMessages(request,message);
return ActionForward;
JSP 页面中 :
<html:messages id=" 指定使用消息的标识 " property=" 消息句柄 " message="true|false">
<bean:write name=" 以上所指 ID 标识 "/>
</html:messages> ==========<html:errors>==============
Action 中 :
ActionMessages message = new ActionMessages();
message.add(" 消息句柄 ",new ActionMessage(" 资源文件中 Key 值 ",String 类型描述信息 ));
this.saveErrors(request,message);
return ActionForward;
JSP 页面中 :
<html:errors property=" 消息句柄 "/> 如果Action中这样设定(false),页面的提示信息将不从资源文件里读取:
ActionMessages message = new ActionMessages();
message.add("消息句柄",new ActionMessage("String类型描述信息));",false));
this.saveErrors(request,message);
return ActionForward;
JSP页面:
<html:errors/>或<html:errors property="消息句柄"/
相关文章推荐
- [struts]HTML:MESSAGES和HTML:ERRORS用法简例
- [struts]HTML:MESSAGES和HTML:ERRORS用法简例
- [struts]HTML:MESSAGES和HTML:ERRORS用法简例
- [struts]HTML:MESSAGES和HTML:ERRORS用法简例
- [struts]HTML:MESSAGES和HTML:ERRORS用法简例
- struts 标签 HTML:MESSAGES和HTML:ERRORS 用法简例
- [struts]HTML:MESSAGES和HTML:ERRORS用法简例
- [struts]HTML:MESSAGES和HTML:ERRORS用法简例
- Struts的html:errors的用法
- HTML:MESSAGES,HTML:ERRORS,用法
- struts1.3中<html:errors>不显示问题
- html:messages 标签用法之一
- Struts 中 Html 标签库 的用法(第二组标签,与Form相关的标签 )
- <html:messages id="">标签 <html:errors/>标签
- 介绍 Struts 中 Html 标签库 的用法(第二组标签,与Form相关的标签 )
- 关于html:errors与html:messages标签的问题
- html:errors标签与ActionMessage和Struts资源文件指南
- Struts 中用Html 标签库的用法(第一部分)
- Struts hasFieldErrors() and hasActionMessages
- 【struts1】html:messages 和 html:ActionErrors