You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Antony Paul <an...@hotmail.com> on 2003/12/08 11:44:31 UTC

ActionForm and password fields.

Hi,
    How to tell struts that I dont want to display the password if
validation fails ? What about other form elements ?

rgds
Antony Paul.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: ActionForm and password fields.

Posted by David Chelimsky <da...@chelimsky.org>.
Sorry, I have no experience w/ DynaActionForms. Someone else is going to
have to field this one - anybody?


----- Original Message ----- 
From: "Antony Paul" <an...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, December 08, 2003 5:00 AM
Subject: Re: ActionForm and password fields.


> Thanks for reply. So for all the fields that I dont want to display set
that
> to null. What if it is DynaActionForm. I dont use validator because I am
> porting an application to Struts of which 20% is completed and we have
> written  JavaScript for it.
>
> rgds.
> Antony Paul.
> ----- Original Message -----
> From: "David Chelimsky" <da...@chelimsky.org>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Monday, December 08, 2003 4:18 PM
> Subject: Re: ActionForm and password fields.
>
>
> > Assuming you're using struts validator, this goes in your ActionForm
> class:
> >
> > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > request) {
> >     ActionErrors errors = super.validate(mapping, request);
> >     if (errors != null) {
> >         setPassword(null);
> >     }
> >     return errors;
> > }
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Antony Paul" <an...@hotmail.com>
> > To: "struts" <st...@jakarta.apache.org>
> > Sent: Monday, December 08, 2003 4:44 AM
> > Subject: ActionForm and password fields.
> >
> >
> > > Hi,
> > >     How to tell struts that I dont want to display the password if
> > > validation fails ? What about other form elements ?
> > >
> > > rgds
> > > Antony Paul.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: ActionForm and password fields.

Posted by Antony Paul <an...@hotmail.com>.
Thanks for reply. So for all the fields that I dont want to display set that
to null. What if it is DynaActionForm. I dont use validator because I am
porting an application to Struts of which 20% is completed and we have
written  JavaScript for it.

rgds.
Antony Paul.
----- Original Message -----
From: "David Chelimsky" <da...@chelimsky.org>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, December 08, 2003 4:18 PM
Subject: Re: ActionForm and password fields.


> Assuming you're using struts validator, this goes in your ActionForm
class:
>
> public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> request) {
>     ActionErrors errors = super.validate(mapping, request);
>     if (errors != null) {
>         setPassword(null);
>     }
>     return errors;
> }
>
>
>
>
> ----- Original Message -----
> From: "Antony Paul" <an...@hotmail.com>
> To: "struts" <st...@jakarta.apache.org>
> Sent: Monday, December 08, 2003 4:44 AM
> Subject: ActionForm and password fields.
>
>
> > Hi,
> >     How to tell struts that I dont want to display the password if
> > validation fails ? What about other form elements ?
> >
> > rgds
> > Antony Paul.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: ActionForm and password fields.

Posted by David Chelimsky <da...@chelimsky.org>.
Assuming you're using struts validator, this goes in your ActionForm class:

public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
    ActionErrors errors = super.validate(mapping, request);
    if (errors != null) {
        setPassword(null);
    }
    return errors;
}




----- Original Message ----- 
From: "Antony Paul" <an...@hotmail.com>
To: "struts" <st...@jakarta.apache.org>
Sent: Monday, December 08, 2003 4:44 AM
Subject: ActionForm and password fields.


> Hi,
>     How to tell struts that I dont want to display the password if
> validation fails ? What about other form elements ?
>
> rgds
> Antony Paul.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: ActionForm and password fields.

Posted by Jerome Curlier <jc...@ca.ibm.com>.
You could use the redisplay attribute:

<html:password property="password" redisplay="false" />

Jerome

"Antony Paul" <an...@hotmail.com> wrote in message
news:Law12-OE62H67yRLVbN0000507b@hotmail.com...
> Hi,
>     How to tell struts that I dont want to display the password if
> validation fails ? What about other form elements ?
>
> rgds
> Antony Paul.




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org