You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Oleg Bondarenko <ol...@emagine.de> on 2001/08/09 18:47:56 UTC

html:errors tag: Bug!

Suppose you have two text fields in your form and the user must input something in each one.
e.g.
...
<html:text property="user"/><br>
<html:errors property="user"/><br>
<html:text property="pass"/><br>
<html:errors property="pass"/><br>
...

in the  corresponding form' validate() method you do
errors.add("user", ....) and errors.add("pass", ....) if the corresponding fields are empty.

You also defined errors.header and errors.footer in your property-file.

Now if the user fills both fields then everything is ok. If the user leaves both fields empty then both errors are displayed ok.

BUT: if the user fills just one field then the following happens. The error message for the empty field is displayed ok, and for the "filled" field only the "error.header" is displayed. This is wrong, and can easily be corrected in the ErrorsTag.java.


Best Regards/Mit freundlichen Grüßen,
Oleg Bondarenko
------------------------------------------------------------------
emagine Germany GmbH
Web Application Development
mailto:Oleg.Bondarenko@emagine.de
Tel.: +49-69-910-64018
Fax.: +49-69-910-69770



--

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.