You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dmitry Kashin <kd...@exch.inec.kharkov.com> on 2003/04/09 14:15:57 UTC
Re[2]: How to use ???
Hello All
You are absolutely right, I can output messages this way and I already
use it, but now I want not output but check if error with specified
key present.
I found example at "Struts in action" chapter 12.
Thanks to authors!!!!!
It looks like this:
<logic:messagesPresent property="password2.notsame" >
<tr bgcolor='red'>
</logic:messagesPresent>
<logic:messagesNotPresent property="password2.notsame">
<tr>
</logic:messagesNotPresent>
NB> you can put the <html:errors> tag in your JSP page, this tag display the
NB> errors that are contained in the request parameter ERROR_KEY you can use it
NB> like this:
NB> in your java class ( action or form) do that:
NB> ActionErrors errors = new ActionErrors();
NB> errors.add( "test", new ActionError(key))
NB> request.setAttribute(ERROR_KEY,errors);
NB> after this your error tag in the jsp page intercept the Error_key attribute
NB> and display it.
NB> Hope that help.
NB> ----- Original Message -----
NB> From: "Dmitry Kashin" <kd...@exch.inec.kharkov.com>
NB> To: <st...@jakarta.apache.org>
NB> Sent: Wednesday, April 09, 2003 11:21 AM
NB> Subject: How to use <html:errors>???
>> Hello All
>> I want to use <html:errors> tag for determine if error appear in
>> current form input element and for example highlight table cell with
>> it instead of displaying error message. For it's not possible without
>> using scriplets, but how exactly have no idea.
>> TIA
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org