Hi Chris,
 
>How will this help? I thought you said that your action code wasn't
>being executed. If that's the case, then it will still bomb before you
>get a chance to call get(String,int).

this method is (eventually) called as part of the processPopulate (its what 
fails)...but unfortunately it doesnt seem to be designed for overriding.

>Is this because poking something into "foo[3]" will auto-expand in a
>LazyDynaBean?

correct, it fills the array (from current size to index) with a LazyDynaBean 
(by default) - this bean can have any property set.

>I'm not sure how this helps at all. Can you describe why you think this
>will work?

if the form is on the session, struts doesn't construct a new one - so we still 
have the original array (on the form), which can be accessed and updated with 
the request parameters - *but* theres an assumption that exactly the same 
number of request params will be submitted.  I'm not sure the implications are 
fully understood by many users...including me until now (thanks Urso)

>If you have a multi-page flow that expects your form bean to continue to
>hold information from past pages, then you will certainly need to store
>the bean in the session. If this is a one-page form submission, then I'm
>not sure why the choice of bean scope is relevant.

there are many choices...:)

>How is this different from your existing setup?

well, firstly there is no such attribute as "indexedBean" - but if there was 
struts could instantiate it and populate the property (sort of how 
LazyValidatorForm works).

Paul


 

________________________________

From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Sat 9/12/2006 3:52 AM
To: Struts Users Mailing List
Subject: Re: Struts1: CHALLENGE "Indexed Properties can not be used with FORMS 
on REQUEST scope!" TRUE or NOT TRUE?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul,

Strachan, Paul wrote:
>> Have you tried calling yourFormBean.get("yourArrayList") and
>> checking to see what it inside of it?
>
> not sure what you mean - the action method is never called as the
> RequestProcessor cant populate the DynaForm from http request
> parameters...

Oh... so it bombs in populatePopulate before your Action.execute is
called? Hmm...

> I think the solution (for DynaForm on request scope) is:
> a) override the get(String,int) method (is dynamic="true" required?)

How will this help? I thought you said that your action code wasn't
being executed. If that's the case, then it will still bomb before you
get a chance to call get(String,int).

> b) use LazyValidatorForm (or/with LazyDynaBean)

Is this because poking something into "foo[3]" will auto-expand in a
LazyDynaBean?

> c) put the form on session

I'm not sure how this helps at all. Can you describe why you think this
will work?

If you have a multi-page flow that expects your form bean to continue to
hold information from past pages, then you will certainly need to store
the bean in the session. If this is a one-page form submission, then I'm
not sure why the choice of bean scope is relevant.

> d) include a new mapping attribute ;) e.g. <form-property
> name="items" type="java.util.ArrayList"
> indexedBean="com.example.MyBean" />

How is this different from your existing setup?

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org 
<http://enigmail.mozdev.org/> 

iD8DBQFFeZhG9CaO5/Lv0PARAv1KAJsH9k0vAqGWb9zH/K9vKQXbmymO3wCeNtg6
MK7aLdO7GI5+2v4/mq22kZ0=
=QSGv
-----END PGP SIGNATURE-----

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



**********************************************************************
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**********************************************************************

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

Reply via email to