Where (in which directory) do you put this action
class? In the directory where all classes that
processes the account information reside? For
example: AppName\WEB-INF\classes\org\ProjName\account\
?
public final class AccountForm extends
DynaValidatorActionForm
implements Serializable
{
public ActionErrors validate( ActionMapping
mapping,
HttpServletRequest request )
{
ActionErrors ae = new ActionErrors();
/*
* only validate if the form has actually been
POSTed.
* This keeps error messages from appearing
when the
* form is displayed for the first time.
*/
if ( request.getMethod().equals( "POST" ) )
{
return super.validate( mapping,
request );
}
else
{
return null;
}
}
}
--- Wendy Smoak <[EMAIL PROTECTED]> wrote:
> From: "Caroline Jen" <[EMAIL PROTECTED]>
> > Where am I supposed to insert the code that you
> give?
> > I use the DynaValidatorForm with plug-in by the
> end of
> > the struts-config.xml file. And I have
> validation.xml
> > and validator-rules.xml file in the
> AppName/WEB-INF
> > directory.
>
> Me, too. You will need to make a Form class. Using
> dynamic forms only gets
> you out of typing all the get/set methods, you may
> still need code in
> 'validate' and 'reset', for example if you're using
> checkboxes.
>
> So I have...
> public final class AccountForm extends
> DynaValidatorActionForm implements
> Serializable
> {
> public ActionErrors validate( ActionMapping
> mapping, HttpServletRequest
> request )
> {
> ...
>
> Don't forget to change struts-config.xml so it uses
> your newly created
> class, not the generic one:
> <form-bean
> name="accountForm"
> type="edu.asu.vpia.struts.AccountForm">
> <form-property name="fund"
> type="java.lang.String"/>
> </form-bean>
>
> --
> Wendy Smoak
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]