<s:if test="hasFieldErrors()">
<s:iterator value="fieldErrors">
<s:iterator value="value" status="statu">
//field的错误消息是List 因此还需要迭代一次
<s:set name="index" value="#statu.index"/>
<s:set name="msg" value="#msg==null?'':#msg+
value.get(#request.index).toString()+'\\\n'"/>//关键代码
</s:iterator>
</s:iterator>
</s:if>
<s:if test="hasActionErrors()">
<s:iterator value="actionErrors">
<script language="JavaScript">
alert("<s:property escape="false"/>")
</script>
</s:iterator>
</s:if>
<s:if test="hasActionMessages()">
<s:iterator value="actionMessages">
<script language="JavaScript">
alert("<s:property escape="false"/>")
</script>
</s:iterator>
</s:if>
//打印转换好格式的fielderror信息
<s:if test="#msg.length()>0">
<script language="JavaScript">
alert("<s:property escape="false" value="#msg"/>")
</script>
</s:if>
分享到:
相关推荐
12.9、使用BodyTagSupport开发迭代输出 12.10、简单标签 12.11、DynamicAttributes接口 12.12、本章摘要 第13章 标准标签库(JSTL) 13.1、JSTL简介 13.2、安装JSTL 1.2 13.3、核心标签库 13.3.1、...
12.9、使用BodyTagSupport开发迭代输出 12.10、简单标签 12.11、DynamicAttributes接口 12.12、本章摘要 第13章 标准标签库(JSTL) 13.1、JSTL简介 13.2、安装JSTL 1.2 13.3、核心标签库 13.3.1、...
12.9、使用BodyTagSupport开发迭代输出 12.10、简单标签 12.11、DynamicAttributes接口 12.12、本章摘要 第13章 标准标签库(JSTL) 13.1、JSTL简介 13.2、安装JSTL 1.2 13.3、核心标签库 13.3.1、标签 ...
12.9、使用BodyTagSupport开发迭代输出 12.10、简单标签 12.11、DynamicAttributes接口 12.12、本章摘要 第13章 标准标签库(JSTL) 13.1、JSTL简介 13.2、安装JSTL 1.2 13.3、核心标签库 13.3.1、...
12.9、使用BodyTagSupport开发迭代输出 12.10、简单标签 12.11、DynamicAttributes接口 12.12、本章摘要 第13章 标准标签库(JSTL) 13.1、JSTL简介 13.2、安装JSTL 1.2 13.3、核心标签库 13.3.1、标签 ...
12.9、使用BodyTagSupport开发迭代输出 12.10、简单标签 12.11、DynamicAttributes接口 12.12、本章摘要 第13章 标准标签库(JSTL) 13.1、JSTL简介 13.2、安装JSTL 1.2 13.3、核心标签库 13.3.1、标签 ...
\contentsline {chapter}{Contents}{2}{section*.1} {1}Java基础}{17}{chapter.1} {1.1}基本语法}{17}{section.1.1} {1.2}数字表达方式}{17}{section.1.2} {1.3}补码}{19}{section.1.3} {1.3.1}总结}{23}{...
12.9、使用BodyTagSupport开发迭代输出 12.10、简单标签 12.11、DynamicAttributes接口 12.12、本章摘要 第13章 标准标签库(JSTL) 13.1、JSTL简介 13.2、安装JSTL 1.2 13.3、核心标签库 13.3.1、...
12.9、使用BodyTagSupport开发迭代输出 12.10、简单标签 12.11、DynamicAttributes接口 12.12、本章摘要 第13章 标准标签库(JSTL) 13.1、JSTL简介 13.2、安装JSTL 1.2 13.3、核心标签库 13.3.1、标签 ...