Thx for your suggestions.

> 1) 2 action mappings -- 1 with validation turned off (welcome.do) and 1
with it on (login.do).

that means for every action, I've to create 1 more action. but it will
almost double the maintainence affort.

> 2) Turn validation off, and handle that in the action:

then I've to give up struts validation framework........

I think these 2 suggestions are simple workaround for this problem, however,
it will break the framework in some degree....
Is there any other solutions come with Struts??

Thanks!
Justy

----- Original Message ----- 
From: "Durham David R Jr Contr 805 CSPTS/SCE" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, October 19, 2004 1:23 AM
Subject: RE: validation question


> > The validation works fine however, when I just type the
> http://localhost:8080/login.do
> > in my browser (no submit), the validation error will show up at once.
> > I understand that it's just like I submit a form to login.do action
> without any
> > parameter. My question is, do struts provide any simple method to
> avoid this and just
> > show no error message?
>
> There's a few different ways to handle this problem.
>
> 1) 2 action mappings -- 1 with validation turned off (welcome.do) and 1
> with it on (login.do).
>
> 2) Turn validation off, and handle that in the action:
>
> login.do
>
> if (isSubmitted) {
> errors = form.validate()
> // redirect or do other authenticate work
> } else {
> return mapping.findForward("login");
> }
>
> HTH,
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to