ok i did not find a very nice solution but this kind of works i think... need
more testing but me time now is limited so i will post this as is... 

i made these methods in myBaseAction (all my actions extend from this class
otherwise put in baseAction) 

    public String clearMessages(){
        log.debug("Clearing out the following messages");
        Collection errors = super.getActionErrors();
        for (Object object : errors) {
            log.debug(object);
        }
        Collection messages = super.getActionMessages();
        for (Object object : messages) {
            log.debug(object);
        }
        super.clearErrorsAndMessages();
        return "Cleared";
    }
    public void addError(String anError){
        super.addActionError(anError);
    }

this can be called from a jps file:

<s:property value="clearMessages()" />   
<s:property value="addError('errror to add')" />

to my messages.jsp i added the clearMessage call like this:

<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:property value="clearMessages()" />
</s:if>

<%-- FieldError Messages - usually set by validation rules --%>
<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:property value="clearMessages()" />
</s:if>

think this will do the trick... not sure though...


-- 
View this message in context: 
http://www.nabble.com/clearing-actionErrors-tp18721237s2369p18754164.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


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

Reply via email to