struts中标签的用法

<logic:messagesPresent>

<logic:messagesPresent>
标签只在要显示特定类型的 Struts 消息时才显示其内容。message 属性定义了消息类型:如果为 true,那么就考虑正常消息,否则就考虑错误消息。在 <logic:messagesPresent> 标签中,<html:message> 标签枚举并显示相应类型的每一个消息。因而在下面 JSP 页中,第一部分显示所有正常应用程序消息,第二部分所有显示错误。

<logic:messagesPresent message="true">
  <p>
    <html:messages id="message" message="true">
      <c:out value="${message}" />
    </html:messages>
  </p>
</logic:messagesPresent>
<logic:messagesPresent>
  <p>
    There was a problem with your request:
  </p>
  <blockquote class="error">
    <html:messages id="error">
      <li><c:out value="${error}" /></li>
    </html:messages>
  </blockquote>
  <c:if test="${not empty requestScope.exception}">

    [...]

  </c:if>
  <p>
    Please correct the problem and try again.
  </p>
</logic:messagesPresent>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值