Re: Help me with my problem in Automatic Validation please
I think that the easiest way is not to use automatic validation. Call validate() manually from action class. If errors found, stick your datalist into request object and forward to dataform.jsp. If you want to redirect, append datalist to URL. You would need to create new ActionForward instance. On 6/28/05, Thai Dang Vu <[EMAIL PROTECTED]> wrote: > Hi everybody, > > This is the situation: > > welcome.jsp > action1 ---(forward)---> dataform.jsp ---(submit)---> > action2 > view.jsp > > I use a drop-down list in dataform.jsp. The data for the list in dataform.jsp > are got from an attribute attached to the request. I use automatic validation > for dataform.jsp. When I go from action1 to dataform.jsp, I can attach a > datalist to the request. My problem is: when I click submit in dataform.jsp > and the data don't meet all the validation requirements, the request is > forwarded back to dataform.jsp. At that time no datalist is attached to the > request so the dataform.jsp can not display correctly. How can I solve this > problem? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help me with my problem in Automatic Validation please
Option 2 assumes that the action1 does not clear down or reset the data form that is used. This could lead to the datalist being present, but not the originally submitted form data. Christopher Marsh-Bourdon www.marsh-bourdon.com _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 28 June 2005 16:54 To: Struts Users Mailing List Subject: Re: Help me with my problem in Automatic Validation please There are two approaches to correcting this. 1. If you are using Sessions, Place the datalist into the session instead of the request. This will insure the datalist is available, but can does add overhead to the application. Additionally, if you do not clean up the data, this can use up memory unnessicarily. 2. Instead of returning the page to the input page, set the input of the action to action1. This will return the page to the action that builds the input page instead of returning to the imput page directly. Inactive hide details for "Thai Dang Vu" <[EMAIL PROTECTED]>"Thai Dang Vu" <[EMAIL PROTECTED]> "Thai Dang Vu" <[EMAIL PROTECTED]> 06/28/2005 11:34 AM Please respond to "Struts Users Mailing List" To cc Subject Help me with my problem in Automatic Validation please Hi everybody, This is the situation: welcome.jsp > action1 ---(forward)---> dataform.jsp ---(submit)---> action2 > view.jsp I use a drop-down list in dataform.jsp. The data for the list in dataform.jsp are got from an attribute attached to the request. I use automatic validation for dataform.jsp. When I go from action1 to dataform.jsp, I can attach a datalist to the request. My problem is: when I click submit in dataform.jsp and the data don't meet all the validation requirements, the request is forwarded back to dataform.jsp. At that time no datalist is attached to the request so the dataform.jsp can not display correctly. How can I solve this problem? Sincerely. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The information contained herein is confidential and is intended solely for the addressee. Access by any other party is unauthorised without the express written permission of the sender. If you are not the intended recipient, please contact the sender either via the company switchboard on +44 (0)20 7623 8000, or via e-mail return. If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. 3166
Re: Help me with my problem in Automatic Validation please
There are two approaches to correcting this. 1. If you are using Sessions, Place the datalist into the session instead of the request. This will insure the datalist is available, but can does add overhead to the application. Additionally, if you do not clean up the data, this can use up memory unnessicarily. 2. Instead of returning the page to the input page, set the input of the action to action1. This will return the page to the action that builds the input page instead of returning to the imput page directly. ">"Thai Dang Vu" <[EMAIL PROTECTED]> "Thai Dang Vu" <[EMAIL PROTECTED]> 06/28/2005 11:34 AM Please respond to "Struts Users Mailing List" To cc Subject Help me with my problem in Automatic Validation please Hi everybody, This is the situation: welcome.jsp > action1 ---(forward)---> dataform.jsp ---(submit)---> action2 > view.jsp I use a drop-down list in dataform.jsp. The data for the list in dataform.jsp are got from an attribute attached to the request. I use automatic validation for dataform.jsp. When I go from action1 to dataform.jsp, I can attach a datalist to the request. My problem is: when I click submit in dataform.jsp and the data don't meet all the validation requirements, the request is forwarded back to dataform.jsp. At that time no datalist is attached to the request so the dataform.jsp can not display correctly. How can I solve this problem? Sincerely. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help me with my problem in Automatic Validation please
The datalist should probably sit in the session scope rather than request. Until there is an "intermediary" scope, this is probably the most cost-effective method. Just ensure that Action2 performs some cleanup that removes it from the scope when you are done with it. Christopher Marsh-Bourdon www.marsh-bourdon.com -Original Message- From: Thai Dang Vu [mailto:[EMAIL PROTECTED] Sent: 28 June 2005 16:35 To: user@struts.apache.org Subject: Help me with my problem in Automatic Validation please Hi everybody, This is the situation: welcome.jsp > action1 ---(forward)---> dataform.jsp ---(submit)---> action2 > view.jsp I use a drop-down list in dataform.jsp. The data for the list in dataform.jsp are got from an attribute attached to the request. I use automatic validation for dataform.jsp. When I go from action1 to dataform.jsp, I can attach a datalist to the request. My problem is: when I click submit in dataform.jsp and the data don't meet all the validation requirements, the request is forwarded back to dataform.jsp. At that time no datalist is attached to the request so the dataform.jsp can not display correctly. How can I solve this problem? Sincerely. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- The information contained herein is confidential and is intended solely for the addressee. Access by any other party is unauthorised without the express written permission of the sender. If you are not the intended recipient, please contact the sender either via the company switchboard on +44 (0)20 7623 8000, or via e-mail return. If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. 3166 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help me with my problem in Automatic Validation please
Hi everybody, This is the situation: welcome.jsp > action1 ---(forward)---> dataform.jsp ---(submit)---> action2 > view.jsp I use a drop-down list in dataform.jsp. The data for the list in dataform.jsp are got from an attribute attached to the request. I use automatic validation for dataform.jsp. When I go from action1 to dataform.jsp, I can attach a datalist to the request. My problem is: when I click submit in dataform.jsp and the data don't meet all the validation requirements, the request is forwarded back to dataform.jsp. At that time no datalist is attached to the request so the dataform.jsp can not display correctly. How can I solve this problem? Sincerely. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]