Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: Strange problem with Validators in Struts 1.2.9

Dave Newton

2007-02-26

Replies:

--- Tom Bednarz <list@(protected):
> Any idea what I am doing wrong here???

Not "wrong", really, but probably you're using an
action-mapping with validate='true' to do the initial
form display. With no defaults it will validate with
an error.

Two ways to get around this are:

1) Use a preliminary action to show the page with no
auto-validation and submit to the action with the
validation turned on.

2) Submit w/ a POST and inside the action check for
GET vs POST and call validate manually (this is what I
did and had base classes to encapsulate that
functionality).

There are probably several more good (or better!)
solutions.

d.




____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.