You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ricardo Andres Quintero <rq...@ubiquando.com.co> on 2004/10/04 17:26:26 UTC

Re: Validate some forms and not the others. How?

I dont understand why u use an ActionForm where u dont collect data neither
use the ActionForm to show data.

?

On Mon, 4 Oct 2004 12:10:49 -0400, Nadia Kunkov wrote
> Hi, 
> I'm building an application using DispatchAction.  I have several 
> screens that use the same ActionForm and I set validate to "true" 
> for this action form. The first page of my app is just a jsp with a 
> single button ( I have to start somewhere :) .  When I click the 
> button on this first page which is not the form and has no input 
> fields, I guess Struts tries to validate it.  What I see in the log 
> is that I do get into the validate method, the validation fails and 
> the action itself is not performed.  How can I tell struts to not 
> validate this first page but validate other screens where there are 
> input fields.  Since I use dispatch action I can't specify validate 
> "false" for some actions and "true" for the others, it's just one validate...
> That brings me to the next question.  Should I use DispatchAction?
> Thanks for your help.
> NK
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


--
Ricardo Andrés Quintero R.
Ubiquando Ltda.


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


Re: Validate some forms and not the others. How?

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
Egg Zackly, Ricardo.  Whay use an ActionForm here and why use 
DispatchAction.  Looks to me like you just want something like 
ForwardAction.


    public ActionForward execute(
        ActionMapping mapping,
        ActionForm form,
        HttpServletRequest request,
        HttpServletResponse response)
        throws Exception {

        // Create a RequestDispatcher the corresponding resource
        String path = mapping.getParameter();

        if (path == null) {
            throw new ServletException(messages.getMessage("forward.path"));
        }

        // Let the controller handle the request
        ActionForward retVal = new ActionForward(path);
        retVal.setContextRelative(true);

        return retVal;
    }


Ricardo Andres Quintero wrote:

>I dont understand why u use an ActionForm where u dont collect data neither
>use the ActionForm to show data.
>
>?
>



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