I want to be
able to have a set of errors returned to an input page such that I can spit out
an error of a particular TYPE next to a particular input, to indicate something
in particular was wrong with this particular field. I'm a bit lost on how
to accomplish this.
Take your
typical login screen consisting of user name and password. If the login
fails, I want the screen to be redrawn with errors that pertain to the user name
field next to the user name field, and the errors associated with the password
next to the password field.
(Ignoring formatting), if my login screen looked like:
---------------------------------------------------------------
Login:
___________________
Password: _____________
---------------------------------------------------------------
...and I
typed in "foo9" in user name and nothing in password and given some contrived
validation rules which will be obvious from the example below, I want something
like the following to be shown:
---------------------------------------------------------------
Login:
____foo9____
* The user
name must be over 8 characters long
* The user
name must only consist of alphabetic characters.
Password: _________________
* The password
was left blank, it must be provided.
---------------------------------------------------------------
Figuring out
all these conditions, constructing the ActionError class with the
ApplicationResources.properties key and adding the ActionErrors to the request
is pretty simple, but I'm lost on the "how to assign an error to a particular
input field" concept.
Is this
covered in the example?
Thanks.
Mike Campbell | Email: [EMAIL PROTECTED] |
S1 Corporation | voice: 678.421.4641 |
Software Engineer | fax: 678.421.4865 |
R & D | web: http://www.s1.com/ |
Black Knight |