A word of caution - Commons BeanUtils[1] handles Maps and
JavaBeans/DynaBeans differently and doing this may change how the
ActionForm is populated - for simple properties it would probably be
fine, but I'm not sure that indexed properties would work the same
way.

This related bug may be of interest:
http://issues.apache.org/jira/browse/BEANUTILS-185

Niall

[1] http://jakarta.apache.org/commons/beanutils/

On 6/23/06, Lance Semmens <[EMAIL PROTECTED]> wrote:
Here's a better solution:
Extend LazyValidatorForm to implement java.util.Map (perhaps
</docs/api/org/apache/struts/validator/index.html>BeanValidatorForm,
which LazyValidatorForm extends from, should do this?)
Then you could access ${myForm.myProperty} in the JSTL.

Lance Semmens wrote:
> Use LazyDynaForm.getMap()
> eg ${myForm.map.myProperty}
>
> Scott Van Wart wrote:
>> I have a class MyForm extends LazyValidatorForm, mapped with name
>> myForm to myAction:
>>
>> <html:form action="/myAction">
>>
>>  ${myForm.myProperty}
>>
>> </html:form>
>>
>> The EL fails with a complaint about accessing myProperty of bean
>> myForm (since there's no getMyProperty() accessor).  How can I access
>> properties with EL?
>>
>> I have
>>
>> <jsp:useBean id="myBean" class="mypkg.MyBean" scope="request">
>>  <jsp:setProperty name="myBean" property="myProperty"
>> value="${myForm.myProperty}" />
>> </jsp:useBean>
>>
>> But naturally, this fails as well.
>>
>> Thanks,
>>  Scott
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>


--
Lance Semmens
Marketpipe Limited
a. 7 Soho Square, London W1D 3QB, UK
t. +44 20 7297 8401
f. +44 20 7297 8427
e. [EMAIL PROTECTED]
w. www.marketpipe.com




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

Reply via email to