JavaTechie

Its all about Technology

<html:errors> in struts December 13, 2007

Filed under: Java — javatechie @ 6:03 am
Tags:
errors.header=<UL>errors.footer=</UL>
errors.prefix=<LI>errors.suffix=</LI>

The default code for queuing an error message is:

errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("error.username.required"));

To specify that this message is for the “username” property, we would code this instead:

errors.add("username", new ActionError("error.username.required"));

<html:errors property="name_of_the_field"/>