struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Lipscombe" <adam.lipsco...@expensys.com>
Subject RE: Newbie question: How to implement conditional validation in an ActionForm?
Date Thu, 13 May 2004 17:17:15 GMT
That did the trick.  Many thanks!


-----Original Message-----
From: John Moore [mailto:john@jmsd.co.uk] 
Sent: 13 May 2004 17:58
To: Struts Users Mailing List
Subject: Re: Newbie question: How to implement conditional validation in an
ActionForm?


Adam Lipscombe wrote:

>
>Is there any way to recognise that the cancel button has been pressed 
>wothin the validate method? Or should I move the validation to the 
>Action classes?
>
>  
>
Well yes, it doesn't really matter where you do it, the same thing 
applies. I presume your Cancel button is a submit button. You can check 
for whether it has been clicked before doing any testing of page number, 
thus:

String submitText=httpServletRequest.getParameter("submit");
if(submitText!=null && submitText.trim().equalsIgnoreCase("Cancel")){
//do whatever

HTH,

John


-- 
==============================================
John Moore - Norwich, UK - john@jmsd.co.uk
==============================================

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



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


Mime
View raw message