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 11:21:41 UTC

How to use ???

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


Re[2]: How to use ???

Posted by Dmitry Kashin <kd...@exch.inec.kharkov.com>.
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


Re: How to use ???

Posted by Noureddine Bekrar <nb...@rennes.jouve.fr>.
you can put the <html:errors> tag in your JSP page, this tag display the
errors that are contained in the request parameter ERROR_KEY you can use it
like this:
in your java class ( action or form) do that:

ActionErrors errors  = new ActionErrors();
errors.add( "test", new ActionError(key))
request.setAttribute(ERROR_KEY,errors);

after this your error tag in the jsp page intercept the Error_key attribute
and display it.

Hope that help.


----- Original Message -----
From: "Dmitry Kashin" <kd...@exch.inec.kharkov.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, April 09, 2003 11:21 AM
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
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org