In your BasicForm's validate() you could do check for the
"parameter"'s value and return "ActionErrors" based on that value;
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request){
/* if load or unspecified return null */
if(org.apache.commons.lang.StringUtils.isEmpty((String)request.getParameter(mapping.getParameter()))
||
if(org.apache.commons.lang.StringUtils.equals((String)request.getParameter(mapping.getParameter()),
"load")){
return null;
}
ActionErrors errors = new ActionErrors();
// do the validation
return errors;
}
On Thu, 13 Jan 2005 09:37:47 -0500, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi all. I have a question that I cannot find the answer to, and hopefully
> someone has run in to this.
>
> I have 3 Actions and 2 Forms
>
> AnnuityAction <-> AnnuityForm , BasicAction <-> BasicForm
>
> I have an abstract class called LaserAction that extends LookupDispatchAction.
> Both AnnuityAction and Basicform extend LaserAction. LaserAction overrides g
> etMethodName(mapping, form,request, response, parameter)and defines the
> abstract
> method load. If no method is specified in the request then it calls load by
> default. This works perfectly, but I am running into issues with validation
> and
> forwarding.
>
> Here is my problem,
>
> When the user clicks "previous" on the AnnuityAction, the previous method is
> called. Previous saves the page, then forwards to /basic.do, which by default
> will call load. Is there any way to set validate=false for the forward?
> I know you can do it for the action declaration, but I only want to disable it
> for this particular forward. The problem is that struts is calling
> BasicForm.validate(mapping, request) before it reaches
> BasicAction.load(mapping, form, request, response). I would like to not have
> to
> declare an action such as /basicLoad that disables validation. I'm trying to
> introduce struts at my new position, and adding more mappings would just make
> things more confusing for the other developers.
>
> Thanks,
> Todd
>
> ---------------------------------------------------------------------
> 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]