RE: Correct Prepopulate Method

2005-03-17 Thread David G. Friedman
> Like I said, I'm not really sure why the > redirect = "true" would give me > problems, but as soon as I changed it to > false everything worked. Joel, In a nutshell: the 'redirect="true"' causes a message to go back to the client's browser telling it to ask for another page. This causes the re

RE: Correct Prepopulate Method

2005-03-17 Thread Schuster Joel M Contr ESC/NDC
Thanks, that makes sense. > -Original Message- > From: Jeff Beal [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 17, 2005 2:07 PM > To: Struts Users Mailing List > Subject: Re: Correct Prepopulate Method > > With redirect="true", Struts sends an

Re: Correct Prepopulate Method

2005-03-17 Thread Jeff Beal
With redirect="true", Struts sends an HTTP redirect command to the browser, which then makes a request directly to the JSP page. That means that your action and your JSP page are in two *different* requests. Thus, anything that your Action placed into request scope is gone. (I'm surprised that n

RE: Correct Prepopulate Method

2005-03-17 Thread Schuster Joel M Contr ESC/NDC
f your patience reading all this. > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 17, 2005 10:14 AM > To: Struts Users Mailing List > Subject: Re: Correct Prepopulate Method > > Hi Joel, > > From the message y

Re: Correct Prepopulate Method

2005-03-17 Thread Hubert Rabago
Form available to the jsp but it was empty.. Not > the same one that I had linked to the request above. > > It seems to me that really it shouldn't be able to work since the request > form my RunTestsAction is a totally different object than the request for > the jsp page. Thus the example from

RE: Correct Prepopulate Method

2005-03-17 Thread Schuster Joel M Contr ESC/NDC
bago [mailto:[EMAIL PROTECTED] > Sent: Friday, March 11, 2005 9:36 AM > To: Struts Users Mailing List > Subject: Re: Correct Prepopulate Method > > You would usually do prepopulation in a setup form. Which > scope you place the form in depends on how you configure the > action

Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread nitin dubey
Hi Jack, I have been thinking of posting the same problem but was watching this thread to arrive at something that would help me.. Anyways, as you mentioned in this reply that it can be done using single Action, I am into the same. I want to populate the form using dispatch action. All the thin

Re: Correct Prepopulate Method (simple problem) SOLVED.

2005-03-14 Thread Nic Werner
Okay, after some review of my code and such, it is now working! There is not one definite thing, I just double-checked everything I had after taking a break. I want to thank everyone for their input (and patience) and the side emails making sure I was up and running. This is a great community,

Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread Dakota Jack
Note that the key is not to think of the ActionForm as somehow being wedded to the page form. That is a crazy way to think. ///;-) On Mon, 14 Mar 2005 12:43:18 -0800, Dakota Jack <[EMAIL PROTECTED]> wrote: > No problem, Nic. Just trying to see what the problem is. Glad I > asked. I would not

Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread Dakota Jack
No problem, Nic. Just trying to see what the problem is. Glad I asked. I would not have know this was it. So, your client on a browser is seeing a list of users, chooses a user, then has that users attributes displayed and can update them. Right? If so, this is easy. You can use one JSP page

Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread Jeff Beal
On Mon, 14 Mar 2005 11:53:12 -0800, Nic Werner <[EMAIL PROTECTED]> wrote: > Reading the replies here and the Struts FAQ, everyone says "Create two > actions, one to pre-populate the data, and the other to save that data" > - So, the first action populates the data in the Execute() function, > retur

Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread Nic Werner
I apologize as I seem to have hijacked this thread in a direction I didn't intend. Jack, I didn't mean for you to pick through my code, it was just in response to Joe helping me. To answer your question Dakota Jack, in an overall view what you have said is correct: From a page of Users, I want

Re: Correct Prepopulate Method

2005-03-14 Thread Dakota Jack
I am just going to hold out, Nic, until you merely say what you want the client to do without giving any code. If you want to know what to do from me, just tell me what you want the client to do. As I said, this is simple stuff, but dealing with your code just complicates it. If you don't just w

Re: Correct Prepopulate Method

2005-03-14 Thread Joe Germuska
This is where I must be doing something wrong, my UserUpdateAction isn't finding the pre-populated form. Here is my code for both: Hm. is UserUpdateAction expecting certain properties to survive between the requests which are not in the request parameters? By default, form beans have request s

Re: Correct Prepopulate Method

2005-03-14 Thread Nic Werner
See my comments in-line. You've got the idea of what I want to do, Joe. Joe Germuska wrote: At 11:08 PM -0800 3/13/05, Nic Werner wrote: Is what I am doing calling JSP pages directly? From my struts-config below I show them being mapped to Actions. My question was that I have to set the html:form a

Re: Correct Prepopulate Method

2005-03-14 Thread Joe Germuska
At 11:08 PM -0800 3/13/05, Nic Werner wrote: Is what I am doing calling JSP pages directly? From my struts-config below I show them being mapped to Actions. My question was that I have to set the html:form action to be the calling Action in order to populate it, but I want it to submit to a differe

Re: Correct Prepopulate Method

2005-03-14 Thread Dakota Jack
Nic, the pages don't matter in a real sense. Actions process requests using the data from ActionForms and then return an ActionForward. Anytime you want to process a request use them. It is that simple. If you just explain what you want to do, we can give you a dozen ways to do it in all probab

Re: Correct Prepopulate Method

2005-03-14 Thread Dakota Jack
But, Craig has indicated in other places that he thinks my way of doing it resonates with him fine and is consistent with OOP principles. Anyway, who created it and why is a historical answer. The question, I thought, was about logic? ///;-) On Sun, 13 Mar 2005 21:31:43 -0800, Craig McClanah

Re: Correct Prepopulate Method

2005-03-13 Thread Nic Werner
with different actions for new form and edit forms. The same save actions then work either way. -Original Message- From: Nic Werner <[EMAIL PROTECTED]> Date: Sun, 13 Mar 2005 18:13:05 To:Struts Users Mailing List Subject: Re: Correct Prepopulate Method Okay, from the FAQ:

Re: Correct Prepopulate Method

2005-03-13 Thread Craig McClanahan
On Fri, 11 Mar 2005 09:31:33 -0800, Dakota Jack <[EMAIL PROTECTED]> wrote: > > If you do this, you won't think of the ActionForm as some sort of > mirror of the JSP/HTML form which stands between the Action and the > form. The fact that ActionForm was designed originally *precisely* to be a conta

Re: Correct Prepopulate Method

2005-03-13 Thread Nic Werner
struts. How do you get to the point of having a person select inventory and purchase it if you can't first display that inventory? - Joel -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 12:02 PM To: Struts Users Mailing List Subject: Re: Corr

Re: Correct Prepopulate Method

2005-03-12 Thread Dakota Jack
I don't know what to say if you don't see the difference between a page-centric view and a view that uses OOP principles. Page-centric talks about the Actions as if they were serving the pages. The pages are pages. The Actions are Actions. On Sat, 12 Mar 2005 11:43:39 -0800, Jesse Clark <[EMAI

Re: Correct Prepopulate Method

2005-03-12 Thread Jesse Clark
Oops, as I had said in the paragraph that got snipped out, I am still trying to figure out the best way to fit everything together and obviously I misunderstood your comment to Joel. I am very interested to learn more about how to approach struts application design in a less page centric manner

Re: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
As an aside and merely as a suggestion, Joel, you might want to cut out parts of the emails that are not relevant to your point. This cuts down on the size of the output stream and makes things easier to read too. See within: On Fri, 11 Mar 2005 12:39:49 -0700, Schuster Joel M Contr ESC/NDC <[E

Re: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
On Fri, 11 Mar 2005 12:09:25 -0800, Jesse Clark <[EMAIL PROTECTED]> wrote: > Joel, > > Here is a short description from the FAQ that starts to describe the > alternative that Jack mentioned below: > http://struts.apache.org/faqs/newbie.html#prepopulate. > > This approach basically means that you

RE: Correct Prepopulate Method

2005-03-11 Thread Joe Germuska
--- I keep getting the impression that I've missed something in my understanding of how and more importantly why --- I want to understand, not just do things blindly. I understand that the ActionForm is intended to STORE and VALIDATE USER-ENTERED data (off the struts page)... but then there seems t

Re: Correct Prepopulate Method

2005-03-11 Thread Jesse Clark
irst display that inventory? - Joel -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 12:02 PM To: Struts Users Mailing List Subject: Re: Correct Prepopulate Method I may be wrong, Joel, but I think Joe and Hubert are thinking of you instantiating

RE: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
How do you get to the point of having a person select inventory and purchase it if you can't first display that inventory? - Joel -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 12:02 PM To: Struts Users Mailing List Subject: Re: Correct Pr

Re: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
ginal Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Friday, March 11, 2005 10:13 AM > To: Struts Users Mailing List > Subject: Re: Correct Prepopulate Method > > On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC > <[EMAIL PROTECTED]&g

RE: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
again. -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 10:13 AM To: Struts Users Mailing List Subject: Re: Correct Prepopulate Method On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC <[EMAIL PROTECTED]> wrote: > I'm not sure I

Re: Correct Prepopulate Method

2005-03-11 Thread Joe Germuska
Hubert has already pretty well described good coding practice for getting an ActionForm instance. Note that the pages you cited may have been written before the FormBeanConfig object acted as a factory, which is a relatively recent enhancement. Really, though, I think there should probably be

Re: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
t; To: Struts Users Mailing List > Subject: Re: Correct Prepopulate Method > > On Fri, 11 Mar 2005 09:50:59 -0700, Schuster Joel M Contr ESC/NDC > <[EMAIL PROTECTED]> wrote: > > I'm not sure I understand the need for the moduleConfig and such for > > creating the Dy

Re: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
There is no right way. However, if you think Action-centric rather than page-centric everything is really easy. If you do this, you won't think of the ActionForm as some sort of mirror of the JSP/HTML form which stands between the Action and the form. Think, rather, of the Action as something th

RE: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
Thanks... I'll keep playing around using your suggestions. -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 10:13 AM To: Struts Users Mailing List Subject: Re: Correct Prepopulate Method On Fri, 11 Mar 2005 09:50:59 -0700, Schuster J

Re: Correct Prepopulate Method

2005-03-11 Thread Hubert Rabago
efault, which is why that's what I mentioned first. You can choose to use request scope. hth, Hubert > > > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Friday, March 11, 2005 9:36 AM > To: Struts Users Mailing List > Subject: Re: Correc

RE: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 9:48 AM To: Struts Users Mailing List Subject: Re: Correct Prepopulate Method Too bad ActionForms were called "ActionForms" rather than something like "ActionData", "ActionState",

RE: Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
ession scope that we added it into... it just copies it into the request scope too. --- so back to sqare one. :P -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 9:36 AM To: Struts Users Mailing List Subject: Re: Correct Prepopulate Method You w

Re: Correct Prepopulate Method

2005-03-11 Thread Dakota Jack
Too bad ActionForms were called "ActionForms" rather than something like "ActionData", "ActionState", or "ActionContext". The html pages are "populated", I guess, with data. If you try to map ActionForms to html or JSP forms, I think your whole way of looking at the problems becomes completely sk

Re: Correct Prepopulate Method

2005-03-11 Thread Hubert Rabago
You would usually do prepopulation in a setup form. Which scope you place the form in depends on how you configure the action that the form will be submitted to. For example, if you have "/showPage.do" and "/submitForm.do", where submitForm is configured as: Then in the action for showPage

Correct Prepopulate Method

2005-03-11 Thread Schuster Joel M Contr ESC/NDC
I've read a number of articles about correct pre-populate forms methods, including the following: 1. http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html 2. http://struts.apache.org/faqs/newbie.htm