Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java?rev=165247&r1=165246&r2=165247&view=diff ============================================================================== --- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java (original) +++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/annotations/Jpf.java Thu Apr 28 18:12:44 2005 @@ -28,179 +28,336 @@ /** - * Holds jpf annotations to provide a Jpf prefix and local scoping of names. + * Wrapper interface for all Page Flow annotations. */ public interface Jpf { + /** + * Enumeration used by [EMAIL PROTECTED] Controller#multipartHandler()} to determine the type of multipart handler. + */ public enum MultipartHandler { + /** Indicates that multipart handling is disabled in this Controller. **/ disabled, + + /** Indicates that multipart requests will be processed in-memory for this Controller. */ memory, + + /** Indicates that multipart requests will be processed on disk for this Controller. */ disk } + /** + * Enumeration used by [EMAIL PROTECTED] Forward#navigateTo()}, [EMAIL PROTECTED] SimpleAction#navigateTo()}, and + * [EMAIL PROTECTED] ConditionalForward#navigateTo()} to determine the next navigation point. + */ public enum NavigateTo { + /** Indicates that the next page shown should be the most recent one shown. */ currentPage, + + /** Indicates that the next page shown should be the one before the most recent one shown. */ previousPage, + + /** Indicates that the previous action should be re-run. **/ previousAction, + + /** @deprecated Either [EMAIL PROTECTED] #currentPage} or [EMAIL PROTECTED] #previousPage} should be used instead. */ page } + /** + * Enumeration used by [EMAIL PROTECTED] Controller#validatorVersion} to determine the version of Commons Validator that is + * being used. This affects the format of generated Commons Validator configuration files. + */ public enum ValidatorVersion { + /** Indicates that Commons Validator version 1.0 is being used. */ oneZero, + + /** Indicates that Commons Validator version 1.1 is being used. */ oneOne } /** - * Jpf.Controller; was jpf:controller - */ + * Main class-level annotation required to be present on all page flow + * ([EMAIL PROTECTED] org.apache.beehive.netui.pageflow.PageFlowController}-derived) and shared flow + * ([EMAIL PROTECTED] org.apache.beehive.netui.pageflow.SharedFlowController}-derived) classes. + */ @Target( TYPE ) @Retention( RUNTIME ) public @interface Controller { - SharedFlowRef[] sharedFlowRefs() default {}; - - /** - * Location of the Struts merge file; relative to the page flow, or a path from the webapp root. Optional. - */ - String strutsMerge() default ""; - - /** - * The version of the commons-validator DTD to use for our generated validator XML. - */ - ValidatorVersion validatorVersion() default ValidatorVersion.oneZero; + //----------------------- + // Optional attributes... + //----------------------- /** - * Location of the ValidatorPlugIn merge file; relative to the page flow, or a path from the webapp root. - * Optional. + * Array of declarative catches, which can reroute to a page or to a handler method ([EMAIL PROTECTED] ExceptionHandler}) + * when a particular exception is thrown. */ - String validatorMerge() default ""; + Catch[] catches() default {}; /** - * List of additional webapp-relative file paths to be added to the 'pathnames' property of the ValidatorPlugIn - * init. + * Array of additional webapp-relative file paths to be added to the <code>pathnames</code> property of the + * ValidatorPlugIn initialization in the generated Struts config XML for this controller. */ String[] customValidatorConfigs() default {}; /** - * Location of the Tiles Definitions XML files. Must be a path from the webapp root. - * Optional. + * Array of Forwards that can be used from any action ([EMAIL PROTECTED] Action} or [EMAIL PROTECTED] SimpleAction}) or + * exception handler ([EMAIL PROTECTED] ExceptionHandler}) in this controller. An action or exception handler method + * uses a forward by returning a [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.Forward} object whose name matches + * the one in the Forward annotation. A simple action uses a forward by naming it in the + * [EMAIL PROTECTED] SimpleAction#forwardRef} attribute. */ - String[] tilesDefinitionsConfigs() default {}; + Forward[] forwards() default {}; /** - * is pageflow nested (optional ) + * If set to <code>true</code>, a [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.NotLoggedInException} will be thrown + * for any action ([EMAIL PROTECTED] Action} or [EMAIL PROTECTED] SimpleAction}) in this controller when the current + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.handler.LoginHandler} returns <code>null</code> for + * <code>getUserPrincipal</code>. The default LoginHandler simply calls <code>getUserPrincipal</code> on + * [EMAIL PROTECTED] javax.servlet.http.HttpServletRequest}. */ - boolean nested() default false; + boolean loginRequired() default false; /** - * is pageflow long-lived (optional ) + * Only valid for {org.apache.beehive.netui.pageflow.PageFlowController}s. If set to <code>true</code>, then + * this page flow does not get discarded when another page flow is hit. It ramains stored in the background, + * and is reinstated when it is requested again. Long-lived page flows may be deleted using + * {org.apache.beehive.netui.pageflow.PageFlowUtils#removedLongLivedPageFlow}. */ boolean longLived() default false; /** - * roles allowed to access actions in this page flow (optional ) + * Array of message bundles used by this controller. Any message key (like those in validation messages) refers + * to a message in one of the listed bundles. */ - String[] rolesAllowed() default {}; + MessageBundle[] messageBundles() default {}; + + /** + * A value that determines the type of multipart handling for actions ([EMAIL PROTECTED] Action} or [EMAIL PROTECTED] SimpleAction}) + * in this controller. <i>For security, multipart handling is disabled by default.</i>. + */ + MultipartHandler multipartHandler() default MultipartHandler.disabled; /** - * is login required to access actions in this page flow (optional ) + * If set to <code>true</code>, then this is a reusable, modular flow that can be "nested" during other flows. + * It has entry points (actions with optional form bean arguments), and exit points ([EMAIL PROTECTED] Forward}, + * [EMAIL PROTECTED] SimpleAction}, or [EMAIL PROTECTED] ConditionalForward} annotations that have <code>returnAction</code> + * attributes). */ - boolean loginRequired() default false; + boolean nested() default false; /** - * is the pageflow read-only, i.e., are its actions guaranteed not to modify member - * state (optional ) + * If set to <code>true</code>, then by default all actions ([EMAIL PROTECTED] Action} or [EMAIL PROTECTED] SimpleAction}) in this + * controller have "promised" that they will not modify member data. In containers that support clustering, + * this allows the framework to avoid serializing the controller instance for session failover after the + * method is run. This is a performance optimization; it does not have an effect on the behavior of the + * action itself. */ boolean readOnly() default false; /** - * global forwards (optional ) + * Array of roles allowed to access actions in this controller. If this array is non-empty, then two + * exceptions may be thrown when an action ([EMAIL PROTECTED] Action} or [EMAIL PROTECTED] SimpleAction}) in this controller is + * raised: + * <ul> + * <li> + * A [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.NotLoggedInException} will be thrown when the current + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.handler.LoginHandler} returns <code>null</code> for + * <code>getUserPrincipal</code>. The default LoginHandler simply calls + * <code>getUserPrincipal</code> on [EMAIL PROTECTED] javax.servlet.http.HttpServletRequest}. + * </li> + * <li> + * An [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.UnfulfilledRolesException} will be thrown when the + * current [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.handler.LoginHandler} returns + * <code>false</code> from <code>isUserInRole</code> for each of the roles in the list. The + * default LoginHandler simply calls <code>isUserInRole</code> on + * [EMAIL PROTECTED] javax.servlet.http.HttpServletRequest}. + * </li> + * </ul> */ - Forward[] forwards() default {}; + String[] rolesAllowed() default {}; /** - * exception catches (optional ) - */ - Catch[] catches() default {}; + * Array of shared flow references used by a page flow. Each one maps a local shared flow name to an actual + * shared flow type. Referenced shared flows add common actions (addressed in the form + * "<i>shared-flow-name</i>.<i>shared-flow-action-name</i>") and fallback exception handlers, and can provide + * a location for shared state. + */ + SharedFlowRef[] sharedFlowRefs() default {}; /** - * simple actions (optional) + * Array of simple actions. */ SimpleAction[] simpleActions() default {}; /** - * validation rules on a per-bean (class) basis (optional ) + * Location of the "Struts merge" file, whose elements/attributes override those in the Struts config XML file + * generated from this controller. The path is relative to this controller, or, if it starts with '/', is + * relative to a source root. + */ + String strutsMerge() default ""; + + /** + * Array of webapp-relative paths to Tiles Definitions Config XML files. Definitions within these files may + * be referenced in [EMAIL PROTECTED] Forward#tilesDefinition}, [EMAIL PROTECTED] SimpleAction#tilesDefinition}, or + * [EMAIL PROTECTED] ConditionalForward#tilesDefinition}. + */ + String[] tilesDefinitionsConfigs() default {}; + + /** + * Array of validation rules on a per-bean (class) basis. An action ([EMAIL PROTECTED] Action} or [EMAIL PROTECTED] SimpleAction}) + * that accepts a form bean can trigger validation rules for any of these bean types. + * @see ValidateRequired + * @see ValidateMinLength + * @see ValidateMaxLength + * @see ValidateMask + * @see ValidateType + * @see ValidateDate + * @see ValidateRange + * @see ValidateCreditCard + * @see ValidateEmail + * @see ValidateValidWhen + * @see ValidateCustomRule */ ValidatableBean[] validatableBeans() default {}; - MessageBundle[] messageBundles() default {}; + /** + * Location of the "Validator merge" file, whose elements/attributes override those in the ValidatorPlugIn + * config XML file generated from this controller. The path is relative to this controller, or, if it starts + * with '/', is relative to a source root. + */ + String validatorMerge() default ""; - MultipartHandler multipartHandler() default MultipartHandler.disabled; + /** + * The version of the commons-validator DTD to use for the ValidatorPlugIn config XML generated from this + * controller. + */ + ValidatorVersion validatorVersion() default ValidatorVersion.oneZero; } + /** + * Declaration of a shared flow reference, which maps a local shared flow name to an actual shared flow type. + * Referenced shared flows add common actions (addressed in the form + * "<i>shared-flow-name</i>.<i>shared-flow-action-name</i>") and fallback exception handlers, and can provide + * a location for shared state. This annotation is used within [EMAIL PROTECTED] Controller}. + */ + @Target( ANNOTATION_TYPE ) + @Retention( RUNTIME ) + public @interface SharedFlowRef + { + /** + * The local name of the shared flow reference. + */ + String name(); + + /** + * The actual type of the shared flow. + */ + Class type(); + } + + /** + * Annotation used within [EMAIL PROTECTED] SimpleAction} to forward conditionally, based on the evaluation of a JSP 2.0-style + * expression. + */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ConditionalForward { + //----------------------- + // Required attributes... + //----------------------- + /** - * The expression that will trigger this forward (required). + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code> that will trigger this forward. If + * the expression evaluates to <code>true</code>, then the forward will be used. */ String condition(); + //----------------------- + // Optional attributes... + //----------------------- + /** - * The forward name (optional). + * The name of an action to forward to. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, + * [EMAIL PROTECTED] #returnAction}, and [EMAIL PROTECTED] #tilesDefinition}. */ - String name() default ""; - + String action() default ""; + /** - * The forward path. Mutually-exclusive with [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, - * and [EMAIL PROTECTED] #tilesDefinition}. - */ - String path() default ""; - + * When set to <code>true</code>, then this Forward will redirect to a path that is external to the + * current webapp; for example, the following path would redirect to /dir/mypage.jsp in webapp "/myapp": + * <blockquote> + * <code>path="/myapp/dir/mypage.jsp", externalRedirect=true</code> + * </blockquote> + * With <code>externalRedirect</code> set to <code>false</code>, the path above would forward to + * /myapp/dir/mypage.jsp under the <i>current</i> webapp. Note that <code>externalRedirect=true</code> + * implies that <code>redirect=true</code>. + */ + boolean externalRedirect() default false; + /** - * The action to be invoked on the calling page flow. Mutually-exclusive with [EMAIL PROTECTED] #path}, - * [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #action}, and [EMAIL PROTECTED] #tilesDefinition}, and only valid in a nested page flow - * ([EMAIL PROTECTED] Controller#nested} must be <code>true</code>). + * The forward name, which is optional for ConditionalForwards. */ - String returnAction() default ""; + String name() default ""; /** * A symbolic name for the page/action to which to navigate. Mutually-exclusive with [EMAIL PROTECTED] #path}, * [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, and [EMAIL PROTECTED] #tilesDefinition}. + * @see NavigateTo */ NavigateTo navigateTo() default NavigateTo.currentPage; /** - * An action to forward to. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, + * The type of form bean that will be passed along (to a page or to another action) with this forward. A new + * instance of the given class will be created. + */ + Class outputFormBeanType() default Void.class; + + /** + * The name of a member variable whose value will be passed along (to a page or to another action) with this + * forward. + */ + String outputFormBean() default ""; + + /** + * The forward path. Mutually-exclusive with [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, * and [EMAIL PROTECTED] #tilesDefinition}. */ - String action() default ""; - + String path() default ""; + /** - * A Tiles definition to forward to. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, - * [EMAIL PROTECTED] #returnAction}, and [EMAIL PROTECTED] #action}. + * If <code>true</code>, there will be a browser redirect (not a server forward) to the destination path. */ - String tilesDefinition() default ""; + boolean redirect() default false; /** - * Tells whether the original query string will be restored on a rerun of a previous action. Only valid when - * <code>navigateTo</code> is <code>NavigateTo.previousAction</code>. - * @return boolean + * If <code>true</code>, the original URL query string will be restored when the previous page or action is + * run. Only valid when the <code>navigateTo</code> attribute is used. */ boolean restoreQueryString() default false; - Class outputFormBeanType() default Void.class; - String outputFormBean() default ""; - boolean redirect() default false; // optional - boolean externalRedirect() default false; // optional + /** + * The action to be invoked on the calling page flow. Mutually-exclusive with [EMAIL PROTECTED] #path}, + * [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #action}, and [EMAIL PROTECTED] #tilesDefinition}, and only valid in a nested page flow + * ([EMAIL PROTECTED] Controller#nested} must be <code>true</code>). + */ + String returnAction() default ""; + + /** + * A Tiles definition to forward to. The Tiles definition is found in one of the config files specified with + * [EMAIL PROTECTED] Controller#tilesDefinitionsConfigs}. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, + * [EMAIL PROTECTED] #returnAction}, and [EMAIL PROTECTED] #action}. + */ + String tilesDefinition() default ""; } /** - * was jpf:view-properties + * Optional class-level annotation that can store tool-specific view properties. */ @Target( TYPE ) @Retention( SOURCE ) @@ -210,572 +367,1306 @@ } /** - * was jpf:action + * Method-level annotation that configures an action method. This annotation is required for a method to be + * recognized as an action. + * @see SimpleAction */ @Target( METHOD ) @Retention( RUNTIME ) public @interface Action { /** - * page flow-scoped form; references a member variable (bean) in the page flow (optional ) + * Array of declarative catches, which can reroute to a page or to a handler method ([EMAIL PROTECTED] ExceptionHandler}) + * when a particular exception is thrown. */ - String useFormBean() default ""; + Catch[] catches() default {}; /** - * is this action read-only, i.e., is it guaranteed not to modify member state (optional ) + * Enable or disable form validation for this action. If [EMAIL PROTECTED] #validationErrorForward} is set while + * <code>doValidation</code> is not, then validation is enabled automatically. */ - boolean readOnly() default false; - + boolean doValidation() default false; + /** - * roles allowed to access this action (optional ) + * Array of Forwards that can be used from this action. The method uses a forward by returning a + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.Forward} object whose name matches the one in the Forward + * annotation. When an action method returns <code>null</code>, no forwarding is done. */ - String[] rolesAllowed() default {}; + Forward[] forwards() default {}; /** - * is login required to access this action (optional ) + * If set to <code>true</code>, a [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.NotLoggedInException} will be thrown + * for this action when the current [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.handler.LoginHandler} returns + * <code>null</code> for <code>getUserPrincipal</code>. The default LoginHandler simply calls + * <code>getUserPrincipal</code> on [EMAIL PROTECTED] javax.servlet.http.HttpServletRequest}. */ boolean loginRequired() default false; /** - * forwards (optional ) - */ - Forward[] forwards() default {}; - + * Use a session-scoped token to prevent multiple submits to this action. If this value is set to true, then + * <code>isTokenValid</code> is called on [EMAIL PROTECTED] org.apache.struts.util.TokenProcessor} before the action is + * run. If <code>isTokenValid</code> returns <code>false</code>, then a + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.DoubleSubmitException} is thrown. + */ + boolean preventDoubleSubmit() default false; + /** - * exception catches (optional ) + * If set to <code>true</code>, then by default this action has "promised" that it will not modify member data. + * In containers that support clustering, this allows the framework to avoid serializing the controller + * instance for session failover after the action is run. This is a performance optimization; it does not have + * an effect on the behavior of the action itself. */ - Catch[] catches() default {}; + boolean readOnly() default false; /** - * field-level validation rules tied to the action (optional ) + * Array of roles allowed to access this action. If this array is non-empty, then two exceptions may be thrown + * when the action is raised: + * <ul> + * <li> + * A [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.NotLoggedInException} will be thrown when the current + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.handler.LoginHandler} returns <code>null</code> for + * <code>getUserPrincipal</code>. The default LoginHandler simply calls + * <code>getUserPrincipal</code> on [EMAIL PROTECTED] javax.servlet.http.HttpServletRequest}. + * </li> + * <li> + * An [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.UnfulfilledRolesException} will be thrown when the + * current [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.handler.LoginHandler} returns + * <code>false</code> from <code>isUserInRole</code> for each of the roles in the list. The + * default LoginHandler simply calls <code>isUserInRole</code> on + * [EMAIL PROTECTED] javax.servlet.http.HttpServletRequest}. + * </li> + * </ul> */ - ValidatableProperty[] validatableProperties() default {}; + String[] rolesAllowed() default {}; /** - * forward used when validation fails + * If set, then the form bean for this action method will be the named member variable, rather than a + * newly-created instance. This is referred to as a "flow-scoped form bean". Note that if the member variable + * is null, it will be set with a new instance of the correct type. */ - Forward validationErrorForward() default @Jpf.Forward( name="" ); + String useFormBean() default ""; /** - * Turn form validation on or off for this action. - * If [EMAIL PROTECTED] #validationErrorForward()} is not empty, this value is set to <code>true</code>automatically. + * Array of validation rules that are applied to properties on this action's form bean. + * @see ValidateRequired + * @see ValidateMinLength + * @see ValidateMaxLength + * @see ValidateMask + * @see ValidateType + * @see ValidateDate + * @see ValidateRange + * @see ValidateCreditCard + * @see ValidateEmail + * @see ValidateValidWhen + * @see ValidateCustomRule */ - boolean doValidation() default false; + ValidatableProperty[] validatableProperties() default {}; /** - * Prevent multiple submits to this action. If multiple submits occur, a - * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.DoubleSubmitException} is thrown. - */ - boolean preventDoubleSubmit() default false; + * The Forward used when form bean validation fails. Setting this value automatically enables validation for + * this action method, unless [EMAIL PROTECTED] #doValidation} is set to <code>false</code>. Validation is always + * disabled when this value is not set. + */ + Forward validationErrorForward() default @Jpf.Forward( name="" ); } + /** + * A "simple" action, which defines its behavior wholly through an annotation, rather than through a method. + * @see Action + */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface SimpleAction { + //----------------------- + // Required attributes... + //----------------------- + /** - * name (required) + * The action name. */ String name(); - ConditionalForward[] conditionalForwards() default {}; - + //--------------------------------------------- + // Optional attributes, like those on Action... + //--------------------------------------------- + /** - * page flow-scoped form; references a member variable (bean) in the page flow - * (optional ) + * Array of declarative catches, which can reroute to a page or to a handler method ([EMAIL PROTECTED] ExceptionHandler}) + * when a particular exception is thrown. */ - String useFormBean() default ""; + Catch[] catches() default {}; /** - * the type of form bean to use for this action - * (optional ) + * Array of conditional forwards. Each one is triggered by a JSP 2.0-style expression evaluating to + * <code>true</code>. The conditions are evaluated in order, so if more than one would evaluate to + * <code>true</code>, the first one wins. */ - Class useFormBeanType() default Void.class; - + ConditionalForward[] conditionalForwards() default {}; + /** - * is this action read-only, i.e., is it guaranteed not to modify member state - * (optional ) + * Enable or disable form validation for this action. If [EMAIL PROTECTED] #validationErrorForward} is set while + * <code>doValidation</code> is not, then validation is enabled automatically. */ - boolean readOnly() default false; + boolean doValidation() default false; /** - * roles allowed to access this action (optional ) + * The name of a class-level forward (a [EMAIL PROTECTED] Forward} in [EMAIL PROTECTED] Controller#forwards}) which will serve as the + * destination for this simple action. Mutually-exclusive with with [EMAIL PROTECTED] #action}, [EMAIL PROTECTED] #path}, + * [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, and [EMAIL PROTECTED] #tilesDefinition}. */ - String[] rolesAllowed() default {}; + String forwardRef() default ""; /** - * is login required to access this action (optional ) + * If set to <code>true</code>, a [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.NotLoggedInException} will be thrown + * for this action when the current [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.handler.LoginHandler} returns + * <code>null</code> for <code>getUserPrincipal</code>. The default LoginHandler simply calls + * <code>getUserPrincipal</code> on [EMAIL PROTECTED] javax.servlet.http.HttpServletRequest}. */ boolean loginRequired() default false; - + /** - * exception catches (optional ) - */ - Catch[] catches() default {}; + * Use a session-scoped token to prevent multiple submits to this action. If this value is set to true, then + * <code>isTokenValid</code> is called on [EMAIL PROTECTED] org.apache.struts.util.TokenProcessor} before the action is + * run. If <code>isTokenValid</code> returns <code>false</code>, then a + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.DoubleSubmitException} is thrown. + */ + boolean preventDoubleSubmit() default false; /** - * field-level validation rules tied to the action (optional ) + * If set to <code>true</code>, then by default this action has "promised" that it will not modify member data. + * In containers that support clustering, this allows the framework to avoid serializing the controller + * instance for session failover after the action is run. This is a performance optimization; it does not have + * an effect on the behavior of the action itself. */ - ValidatableProperty[] validatableProperties() default {}; - + boolean readOnly() default false; + /** - * forward used when validation fails + * Array of roles allowed to access this action. If this array is non-empty, then two exceptions may be thrown + * when the action is raised: + * <ul> + * <li> + * A [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.NotLoggedInException} will be thrown when the current + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.handler.LoginHandler} returns <code>null</code> for + * <code>getUserPrincipal</code>. The default LoginHandler simply calls + * <code>getUserPrincipal</code> on [EMAIL PROTECTED] javax.servlet.http.HttpServletRequest}. + * </li> + * <li> + * An [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.UnfulfilledRolesException} will be thrown when the + * current [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.handler.LoginHandler} returns + * <code>false</code> from <code>isUserInRole</code> for each of the roles in the list. The + * default LoginHandler simply calls <code>isUserInRole</code> on + * [EMAIL PROTECTED] javax.servlet.http.HttpServletRequest}. + * </li> + * </ul> */ - Forward validationErrorForward() default @Jpf.Forward( name="" ); + String[] rolesAllowed() default {}; /** - * Turn form validation on or off for this action. - * If [EMAIL PROTECTED] #validationErrorForward()} is not empty, this value is set to <code>true</code>automatically. + * If set, then the form bean for this action method will be the named member variable, rather than a + * newly-created instance. This is referred to as a "flow-scoped form bean". Note that if the member variable + * is null, it will be set with a new instance of the correct type. Mutually exclusive with + * [EMAIL PROTECTED] #useFormBeanType}. */ - boolean doValidation() default false; + String useFormBean() default ""; /** - * The forward path. Mutually-exclusive with [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, - * [EMAIL PROTECTED] #tilesDefinition}, and [EMAIL PROTECTED] #forwardRef}. - */ - String path() default ""; + * The type of form bean to use for this action. A new instance of the given class will be created when this + * action is run. Mutually exclusive with [EMAIL PROTECTED] #useFormbean}. + */ + Class useFormBeanType() default Void.class; + + /** + * Array of validation rules that are applied to properties on this action's form bean. + */ + ValidatableProperty[] validatableProperties() default {}; /** - * The action to be invoked on the calling page flow. Mutually-exclusive with [EMAIL PROTECTED] #path}, - * [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #action}, [EMAIL PROTECTED] #tilesDefinition}, and [EMAIL PROTECTED] #forwardRef}, and only valid in - * a nested page flow ([EMAIL PROTECTED] Controller#nested} must be <code>true</code>). + * The Forward used when form bean validation fails. Setting this value automatically enables validation for + * this action method, unless [EMAIL PROTECTED] #doValidation} is set to <code>false</code>. Validation is always + * disabled when this value is not set. + */ + Forward validationErrorForward() default @Jpf.Forward( name="" ); + + + //---------------------------------------------- + // Optional attributes, like those on Forward... + //---------------------------------------------- + + /** + * The name of an action to forward to. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, + * [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #tilesDefinition}, and [EMAIL PROTECTED] #forwardRef}. */ - String returnAction() default ""; - + String action() default ""; + + /** + * When set to <code>true</code>, then this Forward will redirect to a path that is external to the + * current webapp; for example, the following path would redirect to /dir/mypage.jsp in webapp "/myapp": + * <blockquote> + * <code>path="/myapp/dir/mypage.jsp", externalRedirect=true</code> + * </blockquote> + * With <code>externalRedirect</code> set to <code>false</code>, the path above would forward to + * /myapp/dir/mypage.jsp under the <i>current</i> webapp. Note that <code>externalRedirect=true</code> + * implies that <code>redirect=true</code>. + */ + boolean externalRedirect() default false; + /** * A symbolic name for the page/action to which to navigate. Mutually-exclusive with [EMAIL PROTECTED] #path}, - * [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, [EMAIL PROTECTED] #tilesDefinition}, and [EMAIL PROTECTED] #forwardRef}.. + * [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, [EMAIL PROTECTED] #tilesDefinition}, and [EMAIL PROTECTED] #forwardRef}. + * @see NavigateTo */ NavigateTo navigateTo() default NavigateTo.currentPage; /** - * An action to forward to. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, - * [EMAIL PROTECTED] #tilesDefinition}, and [EMAIL PROTECTED] #forwardRef}.. - */ - String action() default ""; - + * The type of form bean that will be passed along (to a page or to another action) with this forward. The + * actual form bean instance is provided on the [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.Forward} object that + * is returned from the action method ([EMAIL PROTECTED] Action}) or the exception handler method + * ([EMAIL PROTECTED] ExceptionHandler}). If that object has no output form bean, then a new instance of the given type + * will be created. + */ + Class outputFormBeanType() default Void.class; + /** - * A Tiles definition to forward to. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, - * [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, and [EMAIL PROTECTED] #forwardRef}.. + * The name of a member variable whose value will be passed along (to a page or to another action) with this + * forward. */ - String tilesDefinition() default ""; + String outputFormBean() default ""; + + /** + * The forward path. Mutually-exclusive with [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, + * [EMAIL PROTECTED] #tilesDefinition}, and [EMAIL PROTECTED] #forwardRef}. + */ + String path() default ""; /** - * The name of a class-level forward ([EMAIL PROTECTED] Forward}). Mutually-exclusive with with [EMAIL PROTECTED] #path}, - * [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #tilesDefinition}, and [EMAIL PROTECTED] #forwardRef}. + * If <code>true</code>, there will be a browser redirect (not a server forward) to the destination path. */ - String forwardRef() default ""; + boolean redirect() default false; /** - * Tells whether the original query string will be restored on a rerun of a previous action. Only valid when - * <code>navigateTo</code> is <code>NavigateTo.previousAction</code>. - * @return boolean + * If <code>true</code>, the original URL query string will be restored when the previous page or action is + * run. Only valid when the <code>navigateTo</code> attribute is used. */ boolean restoreQueryString() default false; - Class outputFormBeanType() default Void.class; - String outputFormBean() default ""; - boolean redirect() default false; // optional - boolean externalRedirect() default false; // optional - /** - * Prevent multiple submits to this action. If multiple submits occur, a - * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.DoubleSubmitException} is thrown. + * The action to be invoked on the calling page flow. Mutually-exclusive with [EMAIL PROTECTED] #path}, + * [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #action}, [EMAIL PROTECTED] #tilesDefinition}, and [EMAIL PROTECTED] #forwardRef}, and only valid in a + * nested page flow ([EMAIL PROTECTED] Controller#nested} must be <code>true</code>). */ - boolean preventDoubleSubmit() default false; + String returnAction() default ""; + + /** + * A Tiles definition to forward to. The Tiles definition is found in one of the config files specified with + * [EMAIL PROTECTED] Controller#tilesDefinitionsConfigs}. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, + * [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, and [EMAIL PROTECTED] #forwardRef}. + */ + String tilesDefinition() default ""; } /** - * was jpf:catch + * A declarative "catch" for exceptions thrown from actions ([EMAIL PROTECTED] Action}, [EMAIL PROTECTED] SimpleAction}). */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface Catch { + //----------------------- + // Required attributes... + //----------------------- + /** - * the type of exception to catch (required ) + * The type of Throwable to handle. */ Class<? extends Throwable> type(); + //----------------------- + // Optional attributes... + //----------------------- + /** - * the Jpf.ExceptionHandler method to invoke when the exception occurs (optional ) - * (cannot be present if path is present ) + * The exception handler method ([EMAIL PROTECTED] ExceptionHandler}) to invoke. Mutually exclusive with [EMAIL PROTECTED] #path}. */ String method() default ""; /** - * the destination URI when the exception occurs (cannot be present if method is - * present) (optional ) - */ - String path() default ""; + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code> or literal string message. This + * message is used in two ways: + * <ul> + * <li>It is sent as an argument to the handler method, if [EMAIL PROTECTED] #method} is specified.</li> + * <li> + * It is used as the message in an [EMAIL PROTECTED] org.apache.struts.action.ActionMessage} object within + * an [EMAIL PROTECTED] org.apache.struts.action.ActionErrors} that is stored in request attribute + * [EMAIL PROTECTED] org.apache.struts.Globals#ERROR_KEY}. The ActionMessage's key is the value of + * [EMAIL PROTECTED] #messageKey}, if set, or the full class name of the exception type otherwise. + * </li> + * </ul> + */ + String message() default ""; /** - * the literal message to send to the exception handler method (optional) + * A message resource within a message bundle [EMAIL PROTECTED] MessageBundle} that is used to look up the message. The + * message is used in two ways: + * <ul> + * <li>It is sent as an argument to the handler method, if [EMAIL PROTECTED] #method} is specified.</li> + * <li> + * It is used as the message in an [EMAIL PROTECTED] org.apache.struts.action.ActionMessage} object within + * an [EMAIL PROTECTED] org.apache.struts.action.ActionErrors} that is stored in request attribute + * [EMAIL PROTECTED] org.apache.struts.Globals#ERROR_KEY}. <i>The value of <code>messageKey</code> is also + * used as the ActionMessage's key.</i> + * </li> + * </ul> */ - String message() default ""; + String messageKey() default ""; /** - * a message-resources key to lookup the message that will be sent to the exception - * handler method (optional ) + * The destination URI to forward to. Mututally exclusive with [EMAIL PROTECTED] #method}. For more [EMAIL PROTECTED] Forward}-style + * options, use the [EMAIL PROTECTED] #method} attribute. */ - String messageKey() default ""; + String path() default ""; } /** - * was jpf:exception-handler + * Method-level annotation that configures an exception handler method, which is invoked when a [EMAIL PROTECTED] Catch} is + * triggered. This annotation is required for a method to be recognized as an exception handler. */ @Target( METHOD ) @Retention( RUNTIME ) public @interface ExceptionHandler { /** - * forwards (optional ) + * Array of Forwards that can be used from this exception handler. The method uses a forward by returning a + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.Forward} object whose name matches the one in the Forward + * annotation. When an exception handler method returns <code>null</code>, no forwarding is done. */ Forward[] forwards() default {}; /** - * is the exception handler read-only, i.e., is it guaranteed not to modify member - * state (optional ) + * If set to <code>true</code>, then by default this exception handler has "promised" that it will not modify + * member data. In containers that support clustering, this allows the framework to avoid serializing the + * controller instance for session failover after the method is run. This is a performance optimization; it + * does not have an effect on the behavior of the exception handler itself. */ boolean readOnly() default false; } /** - * was jpf:forward + * A destination that is used by actions ([EMAIL PROTECTED] Action}, [EMAIL PROTECTED] SimpleAction}) and exception handlers + * [EMAIL PROTECTED] ExceptionHandler}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface Forward { - /** - * the forward name (required ) - */ - String name(); + //----------------------- + // Required attributes... + //----------------------- /** - * The forward path. Mutually-exclusive with [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, - * and [EMAIL PROTECTED] #tilesDefinition}. + * The forward name. An action method ([EMAIL PROTECTED] Action}) or an exception handler method + * ([EMAIL PROTECTED] ExceptionHandler}) can use this forward by returning a + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.Forward} object that is initialized with this name. */ - String path() default ""; + String name(); + //----------------------- + // Optional attributes... + //----------------------- + /** - * The action to be invoked on the calling page flow. Mutually-exclusive with [EMAIL PROTECTED] #path}, - * [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #action}, and [EMAIL PROTECTED] #tilesDefinition}, and only valid in a nested page flow - * ([EMAIL PROTECTED] Controller#nested} must be <code>true</code>). + * The name of an action to forward to. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, + * [EMAIL PROTECTED] #returnAction}, and [EMAIL PROTECTED] #tilesDefinition}. */ - String returnAction() default ""; - + String action() default ""; + + /** + * Array of action outputs (name/type) that will be passed along with this forward. Action outputs are used + * within a page by databinding to <code>${pageInput.</code><i>action-output-name</i><code>}</code>. + */ + /** + * Array of action output declarations to be associated with this Forward. An actual action output is passed on + * a [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.Forward} object. An action output supplies a "page input" in a + * page, where it is accessed by databinding to + * <code>${pageInput.</code><i>action-output-name</i><code>}</code>. + */ + ActionOutput[] actionOutputs() default {}; + + /** + * When set to <code>true</code>, then this Forward will redirect to a path that is external to the + * current webapp; for example, the following path would redirect to /dir/mypage.jsp in webapp "/myapp": + * <blockquote> + * <code>path="/myapp/dir/mypage.jsp", externalRedirect=true</code> + * </blockquote> + * With <code>externalRedirect</code> set to <code>false</code>, the path above would forward to + * /myapp/dir/mypage.jsp under the <i>current</i> webapp. Note that <code>externalRedirect=true</code> + * implies that <code>redirect=true</code>. + */ + boolean externalRedirect() default false; + /** * A symbolic name for the page/action to which to navigate. Mutually-exclusive with [EMAIL PROTECTED] #path}, * [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, and [EMAIL PROTECTED] #tilesDefinition}. + * @see NavigateTo */ NavigateTo navigateTo() default NavigateTo.currentPage; /** - * An action to forward to. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, + * The type of form bean that will be passed along (to a page or to another action) with this forward. The + * actual form bean instance is provided on the [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.Forward} object that + * is returned from the action method ([EMAIL PROTECTED] Action}) or the exception handler method + * ([EMAIL PROTECTED] ExceptionHandler}). If that object has no output form bean, then a new instance of the given type + * will be created. + */ + Class outputFormBeanType() default Void.class; + + /** + * The name of a member variable whose value will be passed along (to a page or to another action) with this + * forward. + */ + String outputFormBean() default ""; + + /** + * The forward path. Mutually-exclusive with [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #returnAction}, [EMAIL PROTECTED] #action}, * and [EMAIL PROTECTED] #tilesDefinition}. */ - String action() default ""; + String path() default ""; /** - * A Tiles definition to forward to. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, - * [EMAIL PROTECTED] #returnAction}, and [EMAIL PROTECTED] #action}. + * If <code>true</code>, there will be a browser redirect (not a server forward) to the destination path. */ - String tilesDefinition() default ""; - + boolean redirect() default false; + /** - * Tells whether the original query string will be restored on a rerun of a previous action. Only valid when - * <code>navigateTo</code> is <code>NavigateTo.previousAction</code>. - * @return boolean + * If <code>true</code>, the original URL query string will be restored when the previous page or action is + * run. Only valid when the <code>navigateTo</code> attribute is used. */ boolean restoreQueryString() default false; - Class outputFormBeanType() default Void.class; - String outputFormBean() default ""; - boolean redirect() default false; // optional - boolean externalRedirect() default false; // optional - ActionOutput[] actionOutputs() default {}; + /** + * The action to be invoked on the calling page flow. Mutually-exclusive with [EMAIL PROTECTED] #path}, + * [EMAIL PROTECTED] #navigateTo}, [EMAIL PROTECTED] #action}, and [EMAIL PROTECTED] #tilesDefinition}, and only valid in a nested page flow + * ([EMAIL PROTECTED] Controller#nested} must be <code>true</code>). + */ + String returnAction() default ""; + + /** + * A Tiles definition to forward to. The Tiles definition is found in one of the config files specified with + * [EMAIL PROTECTED] Controller#tilesDefinitionsConfigs}. Mutually-exclusive with [EMAIL PROTECTED] #path}, [EMAIL PROTECTED] #navigateTo}, + * [EMAIL PROTECTED] #returnAction}, and [EMAIL PROTECTED] #action}. + */ + String tilesDefinition() default ""; } /** - * page input + * An action output, which is declared in a [EMAIL PROTECTED] Forward} annotation and passed on a + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.Forward} object. An action output supplies a "page input" in a page, + * where it is accessed by databinding to <code>${pageInput.</code><i>action-output-name</i><code>}</code>. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ActionOutput { + /** + * The name of the action output. This is the <i>action-output-name</i> in the databinding expression + * <code>${pageInput.</code><i>action-output-name</i><code>}</code>. + */ String name(); + + /** + * The type of the action output. This will be checked by the runtime if the server is not in production mode, + * and if the type check fails, a [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.MismatchedActionOutputException} + * will be thrown. + */ Class type(); + + /** + * A String version of the type information that can be used by tools or as runtime-accessable information, + * particularly to add generics to the type (generics are "erased" during compilation and are not available + * to the runtime through reflection. + */ String typeHint() default ""; + + /** + * If <code>true</code>, a [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.MissingActionOutputException} will be thrown + * when the associated [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.Forward} object does not include a value for + * this named action output. + */ boolean required() default true; - /** @deprecated Use [EMAIL PROTECTED] #required}. **/ - boolean nullable() default false; } + /** + * Annotation used within [EMAIL PROTECTED] Controller} to declare a message bundle for use in the page flow. + */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface MessageBundle { - String bundlePath(); // required - no default - String bundleName() default ""; // optional + /** + * The path to the message bundle, as a ServletContext resource. This may be specified with either '/' or'.' + * as the separator, e.g., <code>bundlePath="foo.bar.MyMessages"</code> or + * <code>bundlePath="foo/bar/MyMessages"</code> (in both cases, foo/bar/MyMessages.properties would be found + * on classpath). + */ + String bundlePath(); + + /** + * <p> + * The name associated with the bundle; if this is <i>not</i> specified, then the bundle becomes the "default + * bundle" for the page flow, and all validation messages implicitly reference it. + * </p> + * <p> + * Named message bundles are databound to with expressions like + * <code>${bundle.</code><i>bundle-name</i><code>.someMessage}</code>, while the default message bundle is + * databound to with expressions like <code>${bundle.default.someMessage}</code>. + * </p> + */ + String bundleName() default ""; } /** - * Validation message argument: Arg. + * A message argument used within field validation annotations. + * @see ValidateRequired + * @see ValidateMinLength + * @see ValidateMaxLength + * @see ValidateMask + * @see ValidateType + * @see ValidateDate + * @see ValidateRange + * @see ValidateCreditCard + * @see ValidateEmail + * @see ValidateValidWhen + * @see ValidateCustomRule */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface MessageArg { + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the message argument. Mutually-exclusive with [EMAIL PROTECTED] #argKey}. + */ String arg() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the argument. Mutually-exclusive with [EMAIL PROTECTED] #arg}. + * @see MessageBundle + */ String argKey() default ""; + + /** + * The name of the message bundle in which to look up the argument value. Requires [EMAIL PROTECTED] #argKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * The position of this argument in the associated message; for example, position 2 would replace the string + * <code>{2}</code> in the message. This defaults to the position in the containing <code>messageArgs</code> + * array. + */ int position() default -1; } /** - * Validation rule: Required. + * A validation rule that will fail if it is applied to a property that has no value. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateRequired { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * Validation rule: MinLength. + * A validation rule that will fail if it is applied to a property that has a non-empty value whose length is less + * than a given number of characters. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateMinLength { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; - int chars(); // required + + /** + * The minimum number of characters for the property value. + */ + int chars(); + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * Validation rule: MaxLength. + * A validation rule that will fail if it is applied to a property that has a non-empty value whose length is + * greater than a given number of characters. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateMaxLength { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; - int chars(); // required + + /** + * The maximum number of characters for the property value. + */ + int chars(); + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * Validation rule: Mask. + * A validation rule that will fail if it is applied to a property that has a non-empty value which does not match + * a given regular expression. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateMask { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; - String regex(); // required + + /** + * The regular expression that must be matched. + */ + String regex(); + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * Validation rule: Byte. + * A validation rule that will fail if it is applied to a property that has a non-empty value which cannot be + * converted to a given primitive type. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateType { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; + + /** + * The type to which the property must be convertible; must be a primitive type, e.g., <code>int.class</code>. + */ Class type(); + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * Validation rule: Date. + * A validation rule that will fail if it is applied to a property that has a non-empty value which is not a date + * in a given format. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateDate { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; - String pattern(); // required + + /** + * The date pattern which will be used to initialize a <code>java.text.SimpleDateFormat</code>. + */ + String pattern(); + + /** + * If set to <code>true</code>, then every element of the date must match the pattern exactly; for example, + * "9/10/1973" would not match the pattern "MM/dd/yyyy". + */ boolean strict() default false; + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * Validation rule: Range. + * A validation rule that will fail if it is applied to a property that has a non-empty value which is not a number + * within a given range. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateRange { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; + + /** + * The minimum integer value; requires [EMAIL PROTECTED] #maxInt}, and mutually-exclusive with [EMAIL PROTECTED] #minFloat}. + */ long minInt() default 0; + + /** + * The maximum integer value; requires [EMAIL PROTECTED] #minInt}, and mutually-exclusive with [EMAIL PROTECTED] #maxFloat}. + */ long maxInt() default -1; + + /** + * The minimum floating-point value; requires [EMAIL PROTECTED] #maxFloat}, and mutually-exclusive with [EMAIL PROTECTED] #minInt}. + */ double minFloat() default 0; + + /** + * The maximum floating-point value; requires [EMAIL PROTECTED] #minFloat}, and mutually-exclusive with [EMAIL PROTECTED] #maxInt}. + */ double maxFloat() default -1; + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * Validation rule: CreditCard. + * A validation rule that will fail if it is applied to a property that has a non-empty value which is not a valid + * credit card number. Note that this performs checks against the string only; it does not consult any sort of + * service to verify the actual credit card number. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateCreditCard { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * Validation rule: Email. + * A validation rule that will fail if it is applied to a property that has a non-empty value which is not a valid + * email address. Note that this performs checks against the string only; it does not consult any sort of service + * to verify the actual address. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateEmail { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * Validation rule: ValidWhen. + * A validation rule that will fail when it is applied to a property that has a non-empty value, and when a given + * expression does not evaluate to <code>true</code>. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateValidWhen { + /** + * If set to <code>false</code>, then this rule will not be applied. + */ boolean enabled() default true; + + /** + * The JSP 2.0-style expression (e.g., <code>${actionForm.someProperty==pageFlow.anotherProperty}</code>) that + * must evaluate to <code>true</code>. + */ String condition(); // required + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } + /** + * A variable name/value that is used by [EMAIL PROTECTED] ValidateCustomRule}. + */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateCustomVariable { + /** + * The variable name. + */ String name(); + + /** + * The variable value. + */ String value(); } /** - * Validation rule: Custom. + * A validation rule that will fail when a given custom ValidatorPlugIn rule fails. + * Used within [EMAIL PROTECTED] ValidatableProperty} and [EMAIL PROTECTED] ValidationLocaleRules}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidateCustomRule { - String rule(); // required + /** + * The name of the custom rule to run. This rule may be specified in a ValidatorPlugIn config that is declared + * with [EMAIL PROTECTED] Controller#customValidatorConfigs}. + */ + String rule(); + + /** + * An array of variables that will be passed to the custom rule. + */ ValidateCustomVariable[] variables() default {}; + + /** + * The JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string that will be used + * as the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + */ String message() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used to look up the error message. Mutually-exclusive with [EMAIL PROTECTED] #messageKey}. + * @see MessageBundle + */ String messageKey() default ""; + + /** + * The name of the message bundle in which to look up the error message. Requires [EMAIL PROTECTED] #messageKey} to be set. + * @see MessageBundle + */ String bundleName() default ""; + + /** + * An array of message arguments, which will be used for the message obtained from [EMAIL PROTECTED] #message} or + * [EMAIL PROTECTED] #messageKey}, whichever is specified. + */ MessageArg[] messageArgs() default {}; } /** - * List of field validation rules. Can be present on a bean property (method or field), - * or within a [EMAIL PROTECTED] ValidatableProperty}. + * A set of validation rules that will be applied for a particular locale. Used within a + * [EMAIL PROTECTED] ValidatableProperty}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidationLocaleRules { + /** A ValidateRequired rule that will be applied for the given locale. */ ValidateRequired validateRequired() default @ValidateRequired(enabled=false); + + /** A ValidateMinLength rule that will be applied for the given locale. */ ValidateMinLength validateMinLength() default @ValidateMinLength(enabled=false, chars=-1); + + /** A ValidateMaxLength rule that will be applied for the given locale. */ ValidateMaxLength validateMaxLength() default @ValidateMaxLength(enabled=false, chars=-1); + + /** A ValidateMask rule that will be applied for the given locale. */ ValidateMask validateMask() default @ValidateMask(enabled=false, regex=""); + + /** A ValidateType rule that will be applied for the given locale. */ ValidateType validateType() default @ValidateType(enabled=false, type=void.class); + + /** A ValidateDate rule that will be applied for the given locale. */ ValidateDate validateDate() default @ValidateDate(enabled=false, pattern=""); + + /** A ValidateRange rule that will be applied for the given locale. */ ValidateRange validateRange() default @ValidateRange(enabled=false); + + /** A ValidateCreditCard rule that will be applied for the given locale. */ ValidateCreditCard validateCreditCard() default @ValidateCreditCard(enabled=false); + + /** A ValidateEmail rule that will be applied for the given locale. */ ValidateEmail validateEmail() default @ValidateEmail(enabled=false); + + /** A ValidateValidWhen rule that will be applied for the given locale. */ ValidateValidWhen validateValidWhen() default @ValidateValidWhen(enabled=false, condition=""); + + /** A ValidateCustomRule rule that will be applied for the given locale. */ ValidateCustomRule[] validateCustomRules() default {}; + /** + * The language of the locale for which to apply the rules. Mutually-exclusive with + * [EMAIL PROTECTED] #applyToUnhandledLocales}. + */ String language() default ""; + + /** + * The country of the locale for which to apply the rules. Requires [EMAIL PROTECTED] #language}. + */ String country() default ""; + + /** + * The variant of the locale for which to apply the rules. Requires [EMAIL PROTECTED] #language}. + */ String variant() default ""; + + /** + * If set to <code>true</code>, then these rules will be run only for a locale that has <i>no rules</i> defined + * for it specifically. Mutually-exclusive with [EMAIL PROTECTED] #language}. + */ boolean applyToUnhandledLocales() default false; } /** - * Validation rules associated with particular bean fields. Valid within [EMAIL PROTECTED] ValidatableBean} or [EMAIL PROTECTED] Action}. + * A set of validation rules that will be applied against a property. Used directly on a property getter method, + * or within a [EMAIL PROTECTED] Action}, [EMAIL PROTECTED] SimpleAction}, or [EMAIL PROTECTED] ValidatableBean} annotation. Contains rules to be + * applied for every locale, and sets of locale-specific rules. */ @Target( { ANNOTATION_TYPE, METHOD } ) @Retention( RUNTIME ) public @interface ValidatableProperty { + /** + * The name of the property to run rules against. When this annotation is used on a property getter method, + * <code>propertyName</code> is illegal because the property name is inferred from the method name. + */ String propertyName() default ""; + + /** + * The JSP 2.0-style expression (e.g., <code>${bundle.default.someMessageResource}</code>) or literal string + * that will be used as the first argument to all error messages for this property. When this is specified, + * the individual rules can avoid providing specific messages; instead, a default message will be used. + * Mutually-exclusive with [EMAIL PROTECTED] #displayNameKey}. + */ String displayName() default ""; + + /** + * A key in the default message bundle or in the bundle specified by [EMAIL PROTECTED] #bundleName} that will be + * used as the first argument to all error messages for this property. When this is specified, + * the individual rules can avoid providing specific messages; instead, a default message will be used. + * Mutually-exclusive with [EMAIL PROTECTED] #displayName}. + * @see MessageBundle + */ String displayNameKey() default ""; + + /** A ValidateRequired rule that will be applied for all locales. */ ValidateRequired validateRequired() default @ValidateRequired(enabled=false); + + /** A ValidateMinLength rule that will be applied for all locales. */ ValidateMinLength validateMinLength() default @ValidateMinLength(enabled=false, chars=-1); + + /** A ValidateMaxLength rule that will be applied for all locales. */ ValidateMaxLength validateMaxLength() default @ValidateMaxLength(enabled=false, chars=-1); + + /** A ValidateMask rule that will be applied for all locales. */ ValidateMask validateMask() default @ValidateMask(enabled=false, regex=""); + + /** A ValidateType rule that will be applied for all locales. */ ValidateType validateType() default @ValidateType(enabled=false, type=void.class); + + /** A ValidateDate rule that will be applied for all locales. */ ValidateDate validateDate() default @ValidateDate(enabled=false, pattern=""); + + /** A ValidateRange rule that will be applied for all locales. */ ValidateRange validateRange() default @ValidateRange(enabled=false); + + /** A ValidateCreditCard rule that will be applied for all locales. */ ValidateCreditCard validateCreditCard() default @ValidateCreditCard(enabled=false); + + /** A ValidateEmail rule that will be applied for all locales. */ ValidateEmail validateEmail() default @ValidateEmail(enabled=false); + + /** A ValidateValidWhen rule that will be applied for all locales. */ ValidateValidWhen validateValidWhen() default @ValidateValidWhen(enabled=false, condition=""); + + /** A ValidateCustomRule rule that will be applied for all locales. */ ValidateCustomRule[] validateCustomRules() default {}; + + /** + * An array of sets of locale-specific validation rules. + */ ValidationLocaleRules[] localeRules() default {}; } /** - * Validation fields (and associated rules) associated with a bean type. Valid within - * [EMAIL PROTECTED] Controller}. + * A set of validatable property definitions that will be applied against particular bean type. Used in + * [EMAIL PROTECTED] Controller#validatableBeans}. */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface ValidatableBean { - Class type(); // required - ValidatableProperty[] validatableProperties(); // required + /** + * The bean type for which the validation rules will apply. + */ + Class type(); + + /** + * An array of properties on which to run validation rules. + */ + ValidatableProperty[] validatableProperties(); } + /** + * An optional class-level annotation that can be used on form bean classes with validation rules. It allows the + * form bean class to define its own message bundle that will be used when a message is not found in the default + * message bundle for the page flow in which a validation error message is generated. + */ @Target( TYPE ) @Retention( RUNTIME ) public @interface FormBean { + /** + * The path to the message bundle, as a ServletContext resource. This may be specified with either '/' or'.' + * as the separator, e.g., <code>bundlePath="foo.bar.MyMessages"</code> or + * <code>bundlePath="foo/bar/MyMessages"</code> (in both cases, foo/bar/MyMessages.properties would be found + * on classpath). + */ String messageBundle() default ""; } + /** + * An annotation that causes a field to get automatically initialized with a reference to a + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.SharedFlowController}. The annotation is valid within a page flow + * or a JavaServer Faces backing class. + */ @Target( FIELD ) @Retention( RUNTIME ) public @interface SharedFlowField @@ -786,38 +1677,69 @@ String name(); } + /** + * An annotation that causes a field to get automatically initialized with a reference to the current + * [EMAIL PROTECTED] org.apache.beehive.netui.pageflow.PageFlowController}. The annotation is valid within a JavaServer Faces + * backing class. + */ @Target( FIELD ) @Retention( RUNTIME ) public @interface PageFlowField { } + /** + * A class-level annotation that denotes a JavaServer Faces backing bean. An instance of this class will be + * created whenever a corresponding JSF path is requested (e.g., an instance of foo.MyPage will be created for the + * webapp-relative path "/foo/MyPage.faces"). The instance will be released (removed from the user session) when + * a non-matching path is requested. Faces backing beans can hold component references and event/command handlers. + * The bean instance can be databound to with a JSF-style expression like <code>#{backing.myComponent}</code>. + * + * @see CommandHandler + */ @Target( TYPE ) @Retention( RUNTIME ) public @interface FacesBacking { } + /** + * Method-level annotation that configures a JavaServerFaces command handler which intends to raise Page Flow + * actions. Valid inside a JSF backing bean. The method signature is the standard one for a JSF command handler: + * <blockquote> + * <code>public String myCommandHandler()</code> + * </blockquote> + * where the <code>String</code> returned is the name of a Page Flow action. + * + * @see FacesBacking + */ @Target( METHOD ) @Retention( RUNTIME ) public @interface CommandHandler { + /** + * An array of RaiseAction annotations, which cause form beans to be sent when particular Page Flow actions + * are raised. + */ RaiseAction[] raiseActions() default {}; } + /** + * An annotation used within [EMAIL PROTECTED] CommandHandler} to specify that a form bean should be sent when a particular + * Page Flow action is raised. + */ @Target( ANNOTATION_TYPE ) @Retention( RUNTIME ) public @interface RaiseAction { + /** + * The name of the Page Flow action. + */ String action(); + + /** + * The name of a member variable that will be sent when the action specified with [EMAIL PROTECTED] #action} is raised. + */ String outputFormBean() default ""; - } - - @Target( ANNOTATION_TYPE ) - @Retention( RUNTIME ) - public @interface SharedFlowRef - { - Class type(); - String name(); } }
Modified: incubator/beehive/trunk/netui/src/testRecorder/org/apache/beehive/netui/tools/testrecorder/client/MasterTestRecorderJUnitTest.java URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/testRecorder/org/apache/beehive/netui/tools/testrecorder/client/MasterTestRecorderJUnitTest.java?rev=165247&r1=165246&r2=165247&view=diff ============================================================================== --- incubator/beehive/trunk/netui/src/testRecorder/org/apache/beehive/netui/tools/testrecorder/client/MasterTestRecorderJUnitTest.java (original) +++ incubator/beehive/trunk/netui/src/testRecorder/org/apache/beehive/netui/tools/testrecorder/client/MasterTestRecorderJUnitTest.java Thu Apr 28 18:12:44 2005 @@ -220,8 +220,8 @@ webapp = serverDef.getWebapp( webappName ); if ( webapp == null ) { String msg = "WARNING: no webapp found with name( " + webappName + " )"; - if ( log.isWarnEnabled() ) { - log.warn( msg ); + if ( log.isErrorEnabled() ) { + log.error( msg ); } System.err.println( msg ); continue; @@ -251,9 +251,10 @@ catch ( ConfigException e ) { String msg = "WARNING: failed to obtain test definitions for webapp at( " + webapp.getContextRoot() + " )"; - if ( log.isWarnEnabled() ) { + if ( log.isErrorEnabled() ) { log.warn( msg, e ); } + e.printStackTrace(); System.err.println( msg ); } return tests;
