Re: [Fwd: Having problems with Struts validation framework]

2006-11-26 Thread Laurie Harper
More simply, you can use the  tag to generate your cancel 
button.


For your second question, no, there's no way for different buttons to 
invoke different actions (at least, not without some hokey Javascript 
hackery), but you can have different buttons call different methods on 
the *same* action, using one of the various dispatch actions that come 
with Struts.


L.

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Robin,

All you have to do is set the name of your button to Globals.CANCEL_NAME
(not that exact text, but use that constant to set the "name" attribute
of that submit button element).

- -chris

robin bajaj wrote:

Hello folks,
I found a little issue with the action that's being called.
Please dis-regard my previous mail reporting this issue.
Its resolved now.

However, I have another related issue.
My loyaltyPAge.jsp has two buttons - Exit and continue.

I want the validation to occur only when "Continue" is clicked upon.
But because there's one form in the LoyaltyPage.jsp having these two
buttons, they both get evaluated using one actionMapping (which has the
validate=true).

Is there some facility provided by the Struts framework to
SKIP the validation when a specific button (Exit) is clicked
and ONLY OCCUR when another button(*Continue) is clicked . ???

A corollary question to this would be,
Is it possible for one JSP to have two buttons in one form,
and each button calling a different Action.

Currently as I know, the action gets called based on the
  setting.


Any help would be much appreciated,
regards,
robin.













Subject:
Having problems with Struts validation framework
From:
robin bajaj <[EMAIL PROTECTED]>
Date:
Thu, 23 Nov 2006 11:51:17 -0500
To:
Struts Users Mailing List 

To:
Struts Users Mailing List 


Hi Folks,

--- problem ---
My validation is working but the control doesnt go back to the input
page. I want the input page to render again showing the errors.

--- Details --
I am using Struts 1.1.x for my webApp.
My validation is working fine. (validator-rules.xml and
validation-renewal.xml setup correctly and declared in
struts-config-renewal.xml file).

I want to validate an "Email" text field on "LoyaltyPage.jsp", it has to
be non-empty, valid email address.

Here's the snippet from validation-renewal.xml
-
 

key="error.loyaltyPage2" />



  
--

Here's the snippet from struts-config-renewal.xml
--

   
   
   


--

I do notice that validation is occuring but the control doesnt go back
to the loyaltypage.jsp even though I have mentioned it as the input
attribute in the action mapping. I just get a blank page in the browser.

"input="/LoyaltyPage.jsp"

I have tried changing the input attribute to the action that actually
forwards to loyaltyPage.jsp
"input="/getLoyalty.do"

but in both the cases, I get the blank page in the browser. I want the
loyaltypage.jsp to render again with the error messages showing up.

The following logs show clearly that the validation is occuring, form is
failing the validation, but the input page is still not rendering in the
browser.

What's the missing piece in the whole picture, please help ???


2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
'default'] action.RequestProcessor - Processing a 'POST' for path
'/processLoyalty'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
'default'] util.RequestUtils -  Looking for ActionForm bean instance in
scope 'request' under attribute key 'loyaltyForm'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
'default'] util.RequestUtils -  Creating new ActionForm instance of type
'com.xyz.salescentral.flow.formbean.renewal.LoyaltyForm'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
'default'] util.RequestUtils -  -->
[EMAIL PROTECTED]
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
'default'] action.RequestProcessor -  Storing ActionForm bean instance
in scope 'request' under attribute key 'loyaltyForm'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
'default'] action.RequestProcessor -  Populating bean properties from
this request
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
'default'] beanutils.BeanUtils -
BeanUtils.populate([EMAIL PROTECTED],
{actionValue=[Ljava.lang.String;@1633bbd,
contactMethod=[Ljava.lang.String;@1e719e8,
sendCommunication=[Ljava.lang.String;@155f12b,
email=[Ljava.lang.String;@14c7c48})
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
'default'] beanutils.BeanUtils -
setProperty([EMAIL PROTECTED],
actionValue, [continue])
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
'def

Re: [Fwd: Having problems with Struts validation framework]

2006-11-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Robin,

All you have to do is set the name of your button to Globals.CANCEL_NAME
(not that exact text, but use that constant to set the "name" attribute
of that submit button element).

- -chris

robin bajaj wrote:
> Hello folks,
> I found a little issue with the action that's being called.
> Please dis-regard my previous mail reporting this issue.
> Its resolved now.
> 
> However, I have another related issue.
> My loyaltyPAge.jsp has two buttons - Exit and continue.
> 
> I want the validation to occur only when "Continue" is clicked upon.
> But because there's one form in the LoyaltyPage.jsp having these two
> buttons, they both get evaluated using one actionMapping (which has the
> validate=true).
> 
> Is there some facility provided by the Struts framework to
> SKIP the validation when a specific button (Exit) is clicked
> and ONLY OCCUR when another button(*Continue) is clicked . ???
> 
> A corollary question to this would be,
> Is it possible for one JSP to have two buttons in one form,
> and each button calling a different Action.
> 
> Currently as I know, the action gets called based on the
>   setting.
> 
> 
> Any help would be much appreciated,
> regards,
> robin.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Subject:
> Having problems with Struts validation framework
> From:
> robin bajaj <[EMAIL PROTECTED]>
> Date:
> Thu, 23 Nov 2006 11:51:17 -0500
> To:
> Struts Users Mailing List 
> 
> To:
> Struts Users Mailing List 
> 
> 
> Hi Folks,
> 
> --- problem ---
> My validation is working but the control doesnt go back to the input
> page. I want the input page to render again showing the errors.
> 
> --- Details --
> I am using Struts 1.1.x for my webApp.
> My validation is working fine. (validator-rules.xml and
> validation-renewal.xml setup correctly and declared in
> struts-config-renewal.xml file).
> 
> I want to validate an "Email" text field on "LoyaltyPage.jsp", it has to
> be non-empty, valid email address.
> 
> Here's the snippet from validation-renewal.xml
> -
>  
>  depends="required,email">
>  key="error.loyaltyPage2" />
> 
> 
>   
> --
> 
> Here's the snippet from struts-config-renewal.xml
> --
> type="com.xyz.flow.action.renewal.ProcessLoyaltyPageAction"
>name="loyaltyForm"
>scope="request"
>validate="true"
>input="/LoyaltyPage.jsp" >
>
> path="/processRegistration.do">
> path="/ErrorPageRenewal.jsp">
> 
> 
> --
> 
> I do notice that validation is occuring but the control doesnt go back
> to the loyaltypage.jsp even though I have mentioned it as the input
> attribute in the action mapping. I just get a blank page in the browser.
> 
> "input="/LoyaltyPage.jsp"
> 
> I have tried changing the input attribute to the action that actually
> forwards to loyaltyPage.jsp
> "input="/getLoyalty.do"
> 
> but in both the cases, I get the blank page in the browser. I want the
> loyaltypage.jsp to render again with the error messages showing up.
> 
> The following logs show clearly that the validation is occuring, form is
> failing the validation, but the input page is still not rendering in the
> browser.
> 
> What's the missing piece in the whole picture, please help ???
> 
> 
> 2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
> 'default'] action.RequestProcessor - Processing a 'POST' for path
> '/processLoyalty'
> 2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
> 'default'] util.RequestUtils -  Looking for ActionForm bean instance in
> scope 'request' under attribute key 'loyaltyForm'
> 2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
> 'default'] util.RequestUtils -  Creating new ActionForm instance of type
> 'com.xyz.salescentral.flow.formbean.renewal.LoyaltyForm'
> 2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
> 'default'] util.RequestUtils -  -->
> [EMAIL PROTECTED]
> 2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
> 'default'] action.RequestProcessor -  Storing ActionForm bean instance
> in scope 'request' under attribute key 'loyaltyForm'
> 2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
> 'default'] action.RequestProcessor -  Populating bean properties from
> this request
> 2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue:
> 'default'] beanutils.BeanUtils -
> BeanUtils.populate([EMAIL PROTECTED],
> {actionValue=[Ljava.lang.String;@1633bbd,
> contactMethod=[Ljava.lang.String;@1e719e8,
> sendCommunication=[Ljava.lang.String;@155f12b,
> email=[Ljava.lang.String;@14c7c48})
> 2006-11-23 11:35:39,546 21987

[Fwd: Having problems with Struts validation framework]

2006-11-23 Thread robin bajaj

Hello folks,
I found a little issue with the action that's being called.
Please dis-regard my previous mail reporting this issue.
Its resolved now.

However, I have another related issue.
My loyaltyPAge.jsp has two buttons - Exit and continue.

I want the validation to occur only when "Continue" is clicked upon.
But because there's one form in the LoyaltyPage.jsp having these two 
buttons, they both get evaluated using one actionMapping (which has the 
validate=true).


Is there some facility provided by the Struts framework to
SKIP the validation when a specific button (Exit) is clicked
and ONLY OCCUR when another button(*Continue) is clicked . ???

A corollary question to this would be,
Is it possible for one JSP to have two buttons in one form,
and each button calling a different Action.

Currently as I know, the action gets called based on the
  setting.


Any help would be much appreciated,
regards,
robin.










--- Begin Message ---

Hi Folks,

--- problem ---
My validation is working but the control doesnt go back to the input 
page. I want the input page to render again showing the errors.


--- Details --
I am using Struts 1.1.x for my webApp.
My validation is working fine. (validator-rules.xml and 
validation-renewal.xml setup correctly and declared in 
struts-config-renewal.xml file).


I want to validate an "Email" text field on "LoyaltyPage.jsp", it has to 
be non-empty, valid email address.


Here's the snippet from validation-renewal.xml
-
 





--

Here's the snippet from struts-config-renewal.xml
--

   
   
   path="/ErrorPageRenewal.jsp">



--

I do notice that validation is occuring but the control doesnt go back 
to the loyaltypage.jsp even though I have mentioned it as the input 
attribute in the action mapping. I just get a blank page in the browser.


"input="/LoyaltyPage.jsp"

I have tried changing the input attribute to the action that actually 
forwards to loyaltyPage.jsp

"input="/getLoyalty.do"

but in both the cases, I get the blank page in the browser. I want the 
loyaltypage.jsp to render again with the error messages showing up.


The following logs show clearly that the validation is occuring, form is 
failing the validation, but the input page is still not rendering in the 
browser.


What's the missing piece in the whole picture, please help ???


2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] action.RequestProcessor - Processing a 'POST' for path 
'/processLoyalty'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] util.RequestUtils -  Looking for ActionForm bean instance in 
scope 'request' under attribute key 'loyaltyForm'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] util.RequestUtils -  Creating new ActionForm instance of type 
'com.xyz.salescentral.flow.formbean.renewal.LoyaltyForm'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] util.RequestUtils -  --> 
[EMAIL PROTECTED]
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] action.RequestProcessor -  Storing ActionForm bean instance 
in scope 'request' under attribute key 'loyaltyForm'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] action.RequestProcessor -  Populating bean properties from 
this request
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] beanutils.BeanUtils - 
BeanUtils.populate([EMAIL PROTECTED], 
{actionValue=[Ljava.lang.String;@1633bbd, 
contactMethod=[Ljava.lang.String;@1e719e8, 
sendCommunication=[Ljava.lang.String;@155f12b, 
email=[Ljava.lang.String;@14c7c48})
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] beanutils.BeanUtils - 
setProperty([EMAIL PROTECTED], 
actionValue, [continue])
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] beanutils.ConvertUtils - Convert string 'continue' to class 
'java.lang.String'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] beanutils.ConvertUtils -   Using converter 
[EMAIL PROTECTED]
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] beanutils.BeanUtils - 
setProperty([EMAIL PROTECTED], 
contactMethod, [])
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] beanutils.ConvertUtils - Convert string '' to class 
'java.lang.String'
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] beanutils.ConvertUtils -   Using converter 
[EMAIL PROTECTED]
2006-11-23 11:35:39,546 219875 DEBUG [ExecuteThread: '7' for queue: 
'default'] beanutils.BeanUtils - 
setProperty([EMAIL PROTECTED], 
sendCommunication, [false])
2006-11-2