Hi, Ray,
Why is what you are doing superior to the standard? The standard is
something like the following and is very efficient, I think?
<table>
<tr>
<td>
<!--
ERRORS
-->
<logic:messagesPresent>
<ul>
<html:messages id='error'>
<li>
<bean:write name='error'/>
</li>
</html:messages>
</ul>
</logic:messagesPresent>
<!--
MESSAGES
-->
<logic:messagesPresent message='true'>
<ul>
<html:messages id='message' message='true'>
<li>
<bean:write name='message'/>
</li>
</html:messages>
</ul>
</logic:messagesPresent>
</td>
</tr>
</table>
On 5/27/05, Ray Madigan <[EMAIL PROTECTED]> wrote:
> I am looking for the ability to handle the ActionMessage in a different way
> in my application. In the validate method of the form I create a new
> instance of ActionErrors and add ActionMessage instances to it. In the
> Action dispatch method I call validate and get a non empty ActionErrors
> instance. To figure how to make this work, I can get the iterator to the
> keys and copy it to the request attribute like
>
> Iterator iter = errors.properties ( );
> request.setAttribute ( "ERRORS", errors );
>
> but I can't get the messages associated with the property to allow me to
> manipulate my page.
>
> What I would like is:
>
> for ActionErrors to be a collection, the I could iterate on the errors and
> get the key and the values. I could iterate on the values, or reteive a
> specific one.
>
> I want the ability to inspect an error condition and if it exists or not and
> generate jsp accordingly with an error message.
>
> Does anyone know how to do this?
>
> it would look like, but I dream too much
>
> <c:choose>
> <c:when test='${ not empty ERROR.confirmMatch }'>
> <c:forEach var='message' items='${ERROR.confirmMatch}'>
> <tr><td><fmt:message key='${message}'/></td></tr>
> <!-- Generate specific code -->
> </c:forEach>
> </c:when>
> <c:otherwise>
> <!-- Generate specific code -->
> </c:otherwise>
> </c:choose>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]