Re: ActionForm and default values

2002-02-23 Thread Sarah Farrell
All I can say is that I was really tired last night. Because this certainly does not work. So I still could use some help. At 10:34 PM 2/22/2002 -0700, you wrote: It's Friday, it's late, and I'm answering my own posts replacing newInstance() with getInstance() does the trick. At

Re: ActionForm and default values

2002-02-23 Thread Ted Husted
I'm not sure if we know what you are trying to do =:o) Sarah Farrell wrote: All I can say is that I was really tired last night. Because this certainly does not work. So I still could use some help. -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications

Re: ActionForm and default values

2002-02-23 Thread Sarah Farrell
Short story: I need to retrieve existing ActionForms (ActionFormBeans?) from the Controller Servlet or from the current Session. (I also do not understand the difference between an ActionForm object and an ActionFormBean object). Long story: I have this web application with about 10 forms on

Re: ActionForm and default values

2002-02-23 Thread Ted Husted
If they were all sessions scope form-beans, then they would all be stored in the session context under the name given in the Struts config. Often, developers will use one ActionForm object under one form-bean name for something like this, and just expose part of the object on each page. The

Re: ActionForm and default values

2002-02-23 Thread Sarah Farrell
Thanks Ted. I read about doing the one-form-bean method, but it would be one huge file. My forms have way too many elements on each page with too much validation logic. It would be a nightmare to maintain. Smaller ActionForms for each part makes it easier to see what's going on and easier to

Re: ActionForm and default values

2002-02-23 Thread Sarah Farrell
So the answer, in code, from within my ReviewAction class is the line: ContactForm cForm = (ContactForm) request.getSession(false).getAttribute(contactForm); where contactForm is the name in the struts-config.xml file for the form-bean: form-bean name=contactForm

Re: ActionForm and default values

2002-02-23 Thread Jay sissom
I've missed most of the thread on this, but if the struts-config.xml was as you listed, wouldn't an easier way of getting the form bean be: ContactForm cForm = (ContactForm)form; where form is one of the parameters passed to the perform method? This is the way we do it in our applications.

Re: ActionForm and default values

2002-02-23 Thread Sarah Farrell
I was trying to access a form that wasn't directly associated with that particular Action in the config file. I'm going to want to access about 10 of them all together inside one Action class. Normally, you would do it the way you mentioned when you have one Action mapped with one ActionForm in

Re: ActionForm and default values

2002-02-22 Thread Sarah Farrell
I was trying out Ted's code, slightly modified, in an Action class: protected ActionForm createActionForm(String path) { ActionServlet as = this.getServlet(); ActionMapping mapping = as.findMapping(path); String name = mapping.getName(); ActionForm form = null;

Re: ActionForm and default values

2002-02-22 Thread Sarah Farrell
It's Friday, it's late, and I'm answering my own posts replacing newInstance() with getInstance() does the trick. At 10:02 PM 2/22/2002 -0700, you wrote: I was trying out Ted's code, slightly modified, in an Action class: protected ActionForm createActionForm(String path) {

RE: ActionForm and default values

2002-02-21 Thread Ian Beaumont
: ActionForm and default values Ian Beaumont [EMAIL PROTECTED] writes: This means that in the action for the select item I need to get hold of the form bean for the next page I'm going to so I can populate it. You'll need to pass the ID of the selected item to the action. So your selection view

Re: ActionForm and default values

2002-02-21 Thread rob
- Original Message - From: Corey Klaasmeyer [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, February 21, 2002 4:09 AM Subject: RE: ActionForm and default values This is probably a common question, which should have a corresponding FAQ 'How do I pre

Re: ActionForm and default values

2002-02-21 Thread Ted Husted
keithBacon wrote: Are we missing stuff in the struts example apps? You should be able to copy adapt them when it breaks go back copy again. Contributions welcome -:o) -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 --

Re: ActionForm and default values

2002-02-21 Thread Ted Husted
Corey Klaasmeyer wrote: This is probably a common question, which should have a corresponding FAQ I've drafted a list of FAQs we probably need here: http://jakarta.apache.org/struts/newbie.html Any help in fleshing these out would be appreciated. Ideally, submissions should be in the XML

Re: ActionForm and default values

2002-02-21 Thread Ted Husted
Ian Beaumont wrote: Wouldn't it make more sense to have a pre-initialisation action on the action that is actually connected to the form. This pre-initialisation would then populate the form. Many forms are initialized differently for different purposes. One way for a new record, another way

Re: ActionForm and default values

2002-02-21 Thread keithBacon
working on it - slowly - too slowly. --- Ted Husted [EMAIL PROTECTED] wrote: keithBacon wrote: Are we missing stuff in the struts example apps? You should be able to copy adapt them when it breaks go back copy again. Contributions welcome -:o) -- Ted Husted, Husted dot Com,

RE: ActionForm and default values

2002-02-21 Thread Jesse Alexander (KADA 12)
()))... hope this helps Alexander Jesse -Original Message- From: Ian Beaumont [mailto:[EMAIL PROTECTED]] Sent: Mittwoch, 20. Februar 2002 17:52 To: 'Struts Users Mailing List' Subject: RE: ActionForm and default values This means that in the action for the select item I need to get hold

ActionForm and default values

2002-02-20 Thread Dua, Amit
Hi I want to populate my page with default value So, in order to do that I have a value object (ReportData), ReportDataForm (Form Bean) I populate the Value object through one of the Action classes and then do a Action Forward to one of the Jsp namely ReportData.jsp In the ReportData.jsp I

Re: ActionForm and default values

2002-02-20 Thread Keith
try removing the value= attribute from your html: text. hope that helps. --- Dua, Amit [EMAIL PROTECTED] wrote: Hi I want to populate my page with default value So, in order to do that I have a value object (ReportData), ReportDataForm (Form Bean) I populate the Value object

RE: ActionForm and default values

2002-02-20 Thread Dua, Amit
But then how will I set the default values amit -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:36 AM To: Struts Users Mailing List Subject: Re: ActionForm and default values try removing the value= attribute from your html: text. hope

RE: ActionForm and default values

2002-02-20 Thread Ian Beaumont
values But then how will I set the default values amit -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:36 AM To: Struts Users Mailing List Subject: Re: ActionForm and default values try removing the value= attribute from your html: text

Re: ActionForm and default values

2002-02-20 Thread Jim Crossley
Message- From: Dua, Amit [mailto:[EMAIL PROTECTED]] Sent: 20 February 2002 15:46 To: 'Struts Users Mailing List' Cc: '[EMAIL PROTECTED]' Subject: RE: ActionForm and default values But then how will I set the default values amit -Original Message- From: Keith [mailto:[EMAIL

RE: ActionForm and default values

2002-02-20 Thread Ian Beaumont
:[EMAIL PROTECTED]] Sent: 20 February 2002 16:06 To: Struts Users Mailing List Subject: Re: ActionForm and default values It's pretty simple, I think. 1) The formbean is passed to the action's perform method by the Struts controller. 2) The action populates the formbean (ReportDataForm) from

Re: ActionForm and default values

2002-02-20 Thread keithBacon
and default values But then how will I set the default values amit -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:36 AM To: Struts Users Mailing List Subject: Re: ActionForm and default values try removing

Re: ActionForm and default values

2002-02-20 Thread Jim Crossley
16:06 To: Struts Users Mailing List Subject: Re: ActionForm and default values It's pretty simple, I think. 1) The formbean is passed to the action's perform method by the Struts controller. 2) The action populates the formbean (ReportDataForm) from the value object (ReportData

RE: ActionForm and default values

2002-02-20 Thread Ian Beaumont
fields before the page was displayed. -Original Message- From: Jim Crossley [mailto:[EMAIL PROTECTED]] Sent: 20 February 2002 16:38 To: Struts Users Mailing List Subject: Re: ActionForm and default values Ian Beaumont [EMAIL PROTECTED] writes: Ok - I want to select an item on one page

Re: ActionForm and default values

2002-02-20 Thread Jonathan James
20, 2002 10:52 AM Subject: RE: ActionForm and default values This means that in the action for the select item I need to get hold of the form bean for the next page I'm going to so I can populate it. Two problems with this: 1. How do I get hold of the form bean? Do I create it myself? 2

RE: ActionForm and default values

2002-02-20 Thread Corey Klaasmeyer
everything in your Action. Corey -Original Message- From: Jim Crossley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:38 AM To: Struts Users Mailing List Subject: Re: ActionForm and default values Ian Beaumont [EMAIL PROTECTED] writes: Ok - I want to select an item on one

Re: ActionForm and default values

2002-02-20 Thread Jim Crossley
Ian Beaumont [EMAIL PROTECTED] writes: This means that in the action for the select item I need to get hold of the form bean for the next page I'm going to so I can populate it. You'll need to pass the ID of the selected item to the action. So your selection view will have something like