Jsp Struts2-发送特定信息反馈信息
如何测试上下文中是否存在特定的操作消息Jsp Struts2-发送特定信息反馈信息,jsp,struts2,struts1,Jsp,Struts2,Struts1,如何测试上下文中是否存在特定的操作消息 <logic:messagesPresent message="error" property="my_error"> <table> <tr> <td> <html:messages id="error" property="my_error"> <bean:write name="erro
<logic:messagesPresent message="error" property="my_error">
<table>
<tr>
<td>
<html:messages id="error" property="my_error">
<bean:write name="error"/><br>
</html:messages>
</td>
</tr>
</table>
</logic:messagesPresent>
我尝试了这个,但我只需要搜索我的错误消息
<s:if test="hasActionMessages()">
<table>
<tr>
<td >
<s:actionmessage/>
</td>
</tr>
</table>
</s:if>
操作消息不是错误,它们包含一个单独的集合。无论操作的验证状态如何,都可以为其提供服务 操作消息更适合用户反馈,因为它不会影响流。另一方面,操作错误使操作无效
的可能重复,但如何验证上下文中是否存在特定操作错误/消息?没有任何操作错误/消息。您可以使用OGNL查询特定消息,即
%{actionMessages[0]}
。