RE: ActionForm scoping problems?

2002-02-25 Thread Robert Nocera

This could be off-base, but I think you'll have better results if you
change the case of your form-bean variable name from BillingIDForm to
billingIDForm.  I think it may be using a static class BillingIDForm
and not creating an instance of the class.  Change all references on the
JSP page to billingIDForm and the form-bean name=billingIDForm ...

I know I had a similar problem a while back and it seemed that making
that change fixed it.

Robert Nocera
New England Open Solutions
www.neosllc.com
You supply the vision, we'll do the rest.
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, February 24, 2002 6:02 PM
To: Struts Users Mailing List
Subject: ActionForm scoping problems?


I have an action as such:
---
action
path=/enterBillingEdit
type=express.BillingIDActionForm
name=BillingIDForm
 Rest omitted to save space
---
and the form definition of:

form-bean name=BillingIDForm type=express.BillingIDForm scope
=request/

And I have an entry point JSP which invokes actions and such

I have a post
My BillingIDActionForm action simply loads data into the BillingIDForm
and
saves an attribute in it.

The BillingIDActionForm::perform() then
calls return (mapping.findForward(success));

Where success maps to:
forward name=success path=/BillIDForm.jsp/

The submit for BillIDForm.jsp is html:form action
=/handleBillingIDSubmit.do
where handleBillingIDSubmit maps to:
action
path=/handleBillingIDSubmit
type=express.BillingIDFormSubmitAction
name=BillingIDForm
scope=request
---

In the perform method for: BillingIDFormSubmitAction,
public ActionForward perform(ActionMapping mapping,  ActionForm
form,
etc..)
when I retrieve the variable form and cast it to: BillingIDForm, the
value
I set in the previous action is completely gone.   In this case, it's
back
to null which tells me that a new instance of the BillingIDForm was
created in-between my last action this action.  I thought the
whole
purpose of request scope was to retain the same instance of a form or
bean all the way thru from the entry request to the end of the
request
It does not appear to be the case...

Is there any other decent examples or explanations on when form
variables
descope themselves between requests?If I go and change all of my
scope attributes in the struts.config.xml to session, my application
works fine.Trouble is that I want it to work with request scope.
I
think I am definitely missing a key point here somewhere!

I'm sorry, but I'm just not getting it  :-)

thanks,
Theron















--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: ActionForm scoping problems?

2002-02-24 Thread Tim Sawyer

Have you implemented the reset() method on the action form?  I found that
struts calls reset more often than you would expect.

Tim.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 24, 2002 11:02 PM
To: Struts Users Mailing List
Subject: ActionForm scoping problems?



I have an action as such:
---
action
path=/enterBillingEdit
type=express.BillingIDActionForm
name=BillingIDForm
 Rest omitted to save space
---
and the form definition of:

form-bean name=BillingIDForm type=express.BillingIDForm scope
=request/

And I have an entry point JSP which invokes actions and such

I have a post
My BillingIDActionForm action simply loads data into the BillingIDForm and
saves an attribute in it.

The BillingIDActionForm::perform() then
calls return (mapping.findForward(success));

Where success maps to:
forward name=success path=/BillIDForm.jsp/

The submit for BillIDForm.jsp is html:form action
=/handleBillingIDSubmit.do
where handleBillingIDSubmit maps to:
action
path=/handleBillingIDSubmit
type=express.BillingIDFormSubmitAction
name=BillingIDForm
scope=request
---

In the perform method for: BillingIDFormSubmitAction,
public ActionForward perform(ActionMapping mapping,  ActionForm form,
etc..)
when I retrieve the variable form and cast it to: BillingIDForm, the value
I set in the previous action is completely gone.   In this case, it's back
to null which tells me that a new instance of the BillingIDForm was
created in-between my last action this action.  I thought the whole
purpose of request scope was to retain the same instance of a form or
bean all the way thru from the entry request to the end of the request
It does not appear to be the case...

Is there any other decent examples or explanations on when form variables
descope themselves between requests?If I go and change all of my
scope attributes in the struts.config.xml to session, my application
works fine.Trouble is that I want it to work with request scope.I
think I am definitely missing a key point here somewhere!

I'm sorry, but I'm just not getting it  :-)

thanks,
Theron















--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]