bjorn.de.bakker@(protected):
> Is there an equivalent in JSTL for the logic :messagesPresent ? I've looked on Google, but I can't find a decent example. Someone suggested <c:if test="${! Empty requestScope['org.apache.struts.action.ERROR'}"> but that doesn't work.
JSTL has no direct equivalent, since message management is a Struts
feature, which JSTL knows nothing about. The snippet you posted should
be roughly right. It should be '! empty' rather than '! Empty', the
value may be in session rather than request scope, and if you're
actually looking for messages rather than errors the name of the
constant is different.
> I also need to test if a certain property is added, so I can put
certain labels in red (read, add a css-class to a span if a specific
property is added. E.g. <span<logic:messagesPresent
property="txtUserName">
class="errorMsg"</logic:messagesPresent>>Username:</span>)
Can you get the effect you want using the errorStyle / errorStyleClass /
errorStyleId properties of the html:* input tags? If not, you may be out
of luck since the ActionMessages/ActionErrors classes aren't Map-like :(
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)