I have a messages.jsp[1] that's included (using <%@ include
file="/common/messages.jsp" %>) in my default decorator. This file has a
couple of calls to the valueStack - namely hasActionErrors() and
hasFieldErrors().  This worked fine in WebWork 2.1.x and Struts 2.0.1 - even
when pages where rendered that didn't go through Struts.  However, starting
with the 2.0.6 release, the <s:if> tag throws a NPE because the ValueStack
isn't in the request.  I believe it's a bug, but wanted to check with this
list first to confirm.

Thanks,

Matt

[1] messages.jsp:

<% if (request.getAttribute("struts.valueStack") != null) { %>
<s:if test="hasActionErrors()">
    <div class="error" id="errorMessages">
      <s:iterator value="actionErrors">
         <c:url value= "
            alt="<fmt:message key="icon.warning"/>" class="icon" />
        <s:property escape="false"/><br />
      </s:iterator>
   </div>
</s:if>

<s:if test="hasFieldErrors()">
    <div class="error" id="errorMessages">
      <s:iterator value="fieldErrors">
          <s:iterator value="value">
             <c:url value= "
                alt="<fmt:message key="icon.warning"/>" class="icon" />
             <s:property escape="false"/><br />
          </s:iterator>
      </s:iterator>
   </div>
</s:if>
<% } %>

<%-- Success Messages --%>
<c:if test="${not empty messages}">
    <div class="message" id="successMessages">
        <c:forEach var="msg" items="${messages}">
             <c:url value= "
                alt="<fmt:message key="icon.information"/>" class="icon" />
            <c:out value="${msg}" escapeXml="false"/><br />
        </c:forEach>
    </div>
    <c:remove var="messages" scope="session"/>
</c:if>

-- 
View this message in context: 
http://www.nabble.com/Global-messages.jsp-file-included-in-a-SiteMesh-decorator-tf3400265.html#a9468706
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to