On 2/4/2001 at 11:52 PM Neal Kaiser wrote:
>Just wondering... Where do people typically do their validation? In
the
>ActionServlet or ActionForm? Are there any pros/cons?
Validation is still rather controversial. Some people bypass the Struts
mechanism completely.
Typically, you would start by validating the type and range of data in
ActionForm. Once that passes, you might need to do some further
"business logic" validation in the ActionServlet; for example, to check
a login from a database.
*********** REPLY SEPARATOR ***********
>Has anyone thought about adding data validation tags to the Struts
taglibs?
>
>For example, what if we could do:
>
><form:text property="username" required="true"
validationtype="varchar" />
>
>or something like that.
>
>Could it not generate the necessary javascript, as well as provide an
easy
>to use
>interface for detecting and reporting errors in the Action.perform()?
>
>Just wondering... Where do people typically do their validation? In
the
>ActionServlet
>or ActionForm? Are there any pros/cons?
>
>Thanks,
>Neal
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/