Re: Validation Post-Back help
I was able to fix the problem that I was having by changing my input for the action from the jsp that was being used to the action mapping. That way when the validation fails, it kicks back to the original mapping and runs through that action populating the necessary beans. That way I don't need to keep anything in session. Thanks for the help. On Fri, 31 Dec 2004 01:54:48 -, Cliff <[EMAIL PROTECTED]> wrote: > > I have faced this problem too. > > I tried to get back the previous form from the session and combine > all the field that you need. This logic will happen when validator > is finding an error and it do dynamically. So That is suitable for > all the cases in the App. > > The logic I'm using is simple. It is just cover all the null fields > from previous form which is saved in session. > > Cliff > > --- In [EMAIL PROTECTED], Daniel Kies <[EMAIL PROTECTED]> wrote: > > Greetings. I am using the Validation Framework and I am having > > problems when the validator is finding an error. When the post- > back > > kicks back to the input page, it is not finding the data that was > > previously found in the request. In order for the data to be > > available when kicked back to the calling jsp, I have to put the > data > > in the session instead of the request in the initial action. > > > > My question is this: > > What do I have to do to keep the data available in the request when > > the validator is called and errors are raised? I don't want to > have > > to put everything in the session just for validation purposes. > > > > Thanks in advance. > > > > --- > -- > > 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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Post-Back help
I have faced this problem too. I tried to get back the previous form from the session and combine all the field that you need. This logic will happen when validator is finding an error and it do dynamically. So That is suitable for all the cases in the App. The logic I'm using is simple. It is just cover all the null fields from previous form which is saved in session. Cliff --- In [EMAIL PROTECTED], Daniel Kies <[EMAIL PROTECTED]> wrote: > Greetings. I am using the Validation Framework and I am having > problems when the validator is finding an error. When the post- back > kicks back to the input page, it is not finding the data that was > previously found in the request. In order for the data to be > available when kicked back to the calling jsp, I have to put the data > in the session instead of the request in the initial action. > > My question is this: > What do I have to do to keep the data available in the request when > the validator is called and errors are raised? I don't want to have > to put everything in the session just for validation purposes. > > Thanks in advance. > > --- -- > 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]
Re: Validation Post-Back help
1) In my action class I put a list (statusList) into the request. 2) In the associated JSP, I read through the bean (statusList) and display the data in a drop down box (the way you suggested): 3) When I go to validate(with the framework), and fail, I get Posted back to the inputting .jsp, but when I do, my List, statusList, is no longer there. Is there a way I can configure the call so that it keeps it in the request? Do I have to add it again to the request in the jsp? My struts config has the statusList in the form used typed by a List. I have the feeling I am just mossing something simple here to get the data back in the request. Thanks. On Thu, 30 Dec 2004 14:00:30 -0700, Wendy Smoak <[EMAIL PROTECTED]> wrote: > From: "Daniel Kies" <[EMAIL PROTECTED]> > > in JSP to show the list in a drop down: > > > > > > > property="statusType"/>"> > property="statusType" /> > > > > > > Why are you not using the and (or > ) tags? You don't have to iterate over the > collection, the framework will do it for you. > > Example: > > labelProperty="value"/> > > (contactTypes is a Map sitting in Application scope, but it'll work with > other Collections in other scopes.) > > Is your problem is that you are setting the values back into the form but > they are not getting 'pre-selected' by Struts? (You need to use the Struts > tags for that to happen.) > > Or is your question _how_ to set the values in the dynamic form bean? > Should be... > ( (DynaActionForm) form ).set( "fieldName", myList ); > > Post some of the code that's giving you trouble so we can see what you're > doing instead of guessing. > > -- > Wendy Smoak > > - > 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]
Re: Validation Post-Back help
From: "Daniel Kies" <[EMAIL PROTECTED]> > in JSP to show the list in a drop down: > > > property="statusType"/>"> property="statusType" /> > > Why are you not using the and (or ) tags? You don't have to iterate over the collection, the framework will do it for you. Example: (contactTypes is a Map sitting in Application scope, but it'll work with other Collections in other scopes.) Is your problem is that you are setting the values back into the form but they are not getting 'pre-selected' by Struts? (You need to use the Struts tags for that to happen.) Or is your question _how_ to set the values in the dynamic form bean? Should be... ( (DynaActionForm) form ).set( "fieldName", myList ); Post some of the code that's giving you trouble so we can see what you're doing instead of guessing. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Post-Back help
Wendy - I don't want to use the session for storage because of scalability and memory constraints. I have read and understand the point that as long as I have the field defined in the DynaActionForm that the data will be in the request when I need it after validation fails. -How do you get a list into a list specified in the form bean? Example: in JSP to show the list in a drop down: "> **So what do I need to do to put this data back in the request so it shows up if the validation fails? I can figure it out for the other fields, just not the list. Thanks for any help. On Thu, 30 Dec 2004 10:54:12 -0700, Wendy Smoak <[EMAIL PROTECTED]> wrote: > From: "Daniel Kies" <[EMAIL PROTECTED]> > > Can you offer a decent way of > > searching through the archives? > > I like http://www.mail-archive.com. Put 'struts' in the box on the first > page, then choose the user list. > > Why are you dismissing session scope? > > -- > Wendy Smoak > > - > 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]
Re: Validation Post-Back help
From: "Daniel Kies" <[EMAIL PROTECTED]> > Can you offer a decent way of > searching through the archives? I like http://www.mail-archive.com. Put 'struts' in the box on the first page, then choose the user list. Why are you dismissing session scope? -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Post-Back help
Can you suggest a good way of doing this? There 36,000 threads by subject, starting with ", Author, Date and Thread. I do not personally archive or save all these emails. I have researched through google and looked around a bunch but couldn't find what I needed. I have also looked through several books and come up short, so I am now asking on this list. Can you offer a decent way of searching through the archives? On Thu, 30 Dec 2004 10:00:22 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > This has been asked multiple times on the list and heavily discussed. check > the list archives for details. > > > > -Original Message- > > From: Daniel Kies [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 30, 2004 9:55 AM > > To: user@struts.apache.org > > Subject: Validation Post-Back help > > > > > > Greetings. I am using the Validation Framework and I am having > > problems when the validator is finding an error. When the post-back > > kicks back to the input page, it is not finding the data that was > > previously found in the request. In order for the data to be > > available when kicked back to the calling jsp, I have to put the data > > in the session instead of the request in the initial action. > > > > My question is this: > > What do I have to do to keep the data available in the request when > > the validator is called and errors are raised? I don't want to have > > to put everything in the session just for validation purposes. > > > > Thanks in advance. > > > > - > > 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]
RE: Validation Post-Back help
This has been asked multiple times on the list and heavily discussed. check the list archives for details. > -Original Message- > From: Daniel Kies [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 30, 2004 9:55 AM > To: user@struts.apache.org > Subject: Validation Post-Back help > > > Greetings. I am using the Validation Framework and I am having > problems when the validator is finding an error. When the post-back > kicks back to the input page, it is not finding the data that was > previously found in the request. In order for the data to be > available when kicked back to the calling jsp, I have to put the data > in the session instead of the request in the initial action. > > My question is this: > What do I have to do to keep the data available in the request when > the validator is called and errors are raised? I don't want to have > to put everything in the session just for validation purposes. > > Thanks in advance. > > - > 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]
Validation Post-Back help
Greetings. I am using the Validation Framework and I am having problems when the validator is finding an error. When the post-back kicks back to the input page, it is not finding the data that was previously found in the request. In order for the data to be available when kicked back to the calling jsp, I have to put the data in the session instead of the request in the initial action. My question is this: What do I have to do to keep the data available in the request when the validator is called and errors are raised? I don't want to have to put everything in the session just for validation purposes. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]