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
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
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
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
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
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
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.
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
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;
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) {
: 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
- 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
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
--
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
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
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,
()))...
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
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
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
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
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
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
:[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
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
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
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
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
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
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
29 matches
Mail list logo