FileDocCategorySizeDatePackage
BaseForm.javaAPI DocJBoss 4.2.12266Fri Jul 13 20:56:06 BST 2007xpetstore.web.struts.action

BaseForm

public class BaseForm extends org.apache.struts.action.ActionForm
author
Herve Tchepannou

Fields Summary
private String
_redirectUri
Constructors Summary
Methods Summary
public voidcheckCreditCardDateFormat(java.lang.String value, java.lang.String msg, org.apache.struts.action.ActionErrors errors)


    //~ Methods ----------------------------------------------------------------

              
                                                  
                                             
    
        boolean err = false;

        try
        {
            int i = value.indexOf( "-" );

            if ( ( err = ( i >= 0 ) ) )
            {
                int lhs = Integer.parseInt( value.substring( 0, i ) );
                int rhs = Integer.parseInt( value.substring( i + 1 ) );
                err = !( ( lhs >= 1 ) && ( lhs <= 12 ) && ( rhs >= 0 ) );
            }
        }
        catch ( Exception e )
        {
            err = true;
        }

        if ( err )
        {
            errors.add( "ActionForm", new ActionError( msg ) );
        }
    
public voidcheckLength(java.lang.String value, int len, java.lang.String msg, org.apache.struts.action.ActionErrors errors)

        if ( ( value == null ) || ( value.length(  ) < len ) )
        {
            errors.add( "ActionForm", new ActionError( msg ) );
        }
    
public voidcheckNotEmpty(java.lang.String value, java.lang.String msg, org.apache.struts.action.ActionErrors errors)

        if ( ( value == null ) || ( value.trim(  ).length(  ) == 0 ) )
        {
            errors.add( "ActionForm", new ActionError( msg ) );
        }
    
public java.lang.StringgetRedirectUri()

return
String

        return _redirectUri;
    
public voidsetRedirectUri(java.lang.String redirectUri)
Sets the redirectUri.

param
redirectUri The redirectUri to set

        _redirectUri = redirectUri;