You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Whittaker <mi...@ntlworld.com> on 2003/08/17 15:33:23 UTC
can't access DAF getMap()
Okay I've RTFM.
<html:link> seems it should do the job with its populating from a map
abilities.
<html:link page="/blah.do" name="myForm" property="map" >
TEST
</html:link>
However, I give it my DynaActionForm (with its getMap() method) and the
property 'map' and I get:
javax.servlet.ServletException: No getter method for property map of bean
myForm
which is really wierd, because at the same time I can do:
<c:out value="${myForm.map['aParam']}" />
I think it is looking for a form-property called 'map'. How do I access
this method through html:link ?
--
Mike W
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: can't access DAF getMap()
Posted by Mike Whittaker <mi...@ntlworld.com>.
>I'm not 100% not what your doing so i could be talking nonsense..
>
>If the formBean is available to the page i cant see why you cant access
>its properties.
>
>A simple way of doing this would be to do it in the referring action.
>
>
>Map myFormMap = myForm.getMap();
>
>request.setAttribute("myMap",myFormMap);
>
>then
>
><html:link name="myMap">
Yes, I can do that, thanks for jogging my gramaphone brain!
Pity you can't access directly, perhaps they should have kept DAF param
access as
myForm.map['myParam']
Then you could still get the Map complete with myForm.map
I'm sure there is a good reason they didn't.
Cheers,
Mike W.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: can't access DAF getMap()
Posted by Mark Lowe <ma...@talk21.com>.
I'm not 100% not what your doing so i could be talking nonsense..
If the formBean is available to the page i cant see why you cant access
its properties.
A simple way of doing this would be to do it in the referring action.
Map myFormMap = myForm.getMap();
request.setAttribute("myMap",myFormMap);
then
<html:link name="myMap">
to display all the key=value pairs as parameters or specify the
property as the key.
Cheers Mark
On Sunday, August 17, 2003, at 05:57 PM, Mike Whittaker wrote:
>
>>> sorry mike i meant mapped to the action
>>>
>>> On Sunday, August 17, 2003, at 03:57 PM, Mark Lowe wrote:
>>>
>>>> Is myForm scoped to the page?
>>>>
>>
>
> In fact I'm pretty sure it is impossible to get at getMap()
> due to the under the covers cleverness that allows a DynaBean to be
> used in
> a typical JavaBean role - ie get("myParam") of a DynaBean is available
> to a
> stuts accessor eg myForm.myParam is equivalent to
> myForm.get("myParam").
> So when I try and access getMap() with property="map" it sees it is a
> DynaBean and converts it to get("map").
>
> So the solution?
>
> either a custom method is DAF that delivers what I want and access it
> with
> jstl
>
> or another approach to getting the previous url that allows me to
> alter a
> parameter value.
>
> --
> Mike W>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: can't access DAF getMap()
Posted by Mike Whittaker <mi...@ntlworld.com>.
>>sorry mike i meant mapped to the action
>>
>>On Sunday, August 17, 2003, at 03:57 PM, Mark Lowe wrote:
>>
>>> Is myForm scoped to the page?
>>>
>
In fact I'm pretty sure it is impossible to get at getMap()
due to the under the covers cleverness that allows a DynaBean to be used in
a typical JavaBean role - ie get("myParam") of a DynaBean is available to a
stuts accessor eg myForm.myParam is equivalent to myForm.get("myParam").
So when I try and access getMap() with property="map" it sees it is a
DynaBean and converts it to get("map").
So the solution?
either a custom method is DAF that delivers what I want and access it with
jstl
or another approach to getting the previous url that allows me to alter a
parameter value.
--
Mike W>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: can't access DAF getMap()
Posted by Mike Whittaker <mi...@ntlworld.com>.
>sorry mike i meant mapped to the action
>
>On Sunday, August 17, 2003, at 03:57 PM, Mark Lowe wrote:
>
>> Is myForm scoped to the page?
>>
Well myForm is in that action mappings name attribute
and indeed the error:
No getter method for property map of bean myForm
given for:
<html:link page="/CragResults.do" name="myForm" property="map" >
TEST
</html:link>
indicate the bean is accessible just 'map' is not!
--
Mike W
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: can't access DAF getMap()
Posted by Mark Lowe <ma...@talk21.com>.
sorry mike i meant mapped to the action
On Sunday, August 17, 2003, at 03:57 PM, Mark Lowe wrote:
> Is myForm scoped to the page?
>
> Cheers Mark
>
> On Sunday, August 17, 2003, at 03:21 PM, Mike Whittaker wrote:
>
>>>
>>>
>>> This might work
>>>
>>> <html:link name="myform.map">
>>
>> Cannot find bean myForm.map in any scope
>>
>>>
>>> or
>>>
>>> <html:link name="myform" property="map.property">
>>
>> I want the java.util.Map for property attribute of html:link
>>
>> infact, I'll probably want a different method of subclassed DAF that
>> gives a
>> modification of the Map.
>>
>> I just want to render a link similar to the previous request,
>> changing one
>> params value.
>>
>>>
>>> or
>>>
>>> <html:link name-"myform" property="map('property')">
>>
>> ditto
>>
>>>
>>> in which case what's wrong with
>>>
>>> <html:link name="myForm" property="property">
>>
>> ditto
>>
>> --
>> Mike W
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: can't access DAF getMap()
Posted by Mark Lowe <ma...@talk21.com>.
Is myForm scoped to the page?
Cheers Mark
On Sunday, August 17, 2003, at 03:21 PM, Mike Whittaker wrote:
>>
>>
>> This might work
>>
>> <html:link name="myform.map">
>
> Cannot find bean myForm.map in any scope
>
>>
>> or
>>
>> <html:link name="myform" property="map.property">
>
> I want the java.util.Map for property attribute of html:link
>
> infact, I'll probably want a different method of subclassed DAF that
> gives a
> modification of the Map.
>
> I just want to render a link similar to the previous request, changing
> one
> params value.
>
>>
>> or
>>
>> <html:link name-"myform" property="map('property')">
>
> ditto
>
>>
>> in which case what's wrong with
>>
>> <html:link name="myForm" property="property">
>
> ditto
>
> --
> Mike W
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: can't access DAF getMap()
Posted by Mike Whittaker <mi...@ntlworld.com>.
>
>
>This might work
>
><html:link name="myform.map">
Cannot find bean myForm.map in any scope
>
>or
>
><html:link name="myform" property="map.property">
I want the java.util.Map for property attribute of html:link
infact, I'll probably want a different method of subclassed DAF that gives a
modification of the Map.
I just want to render a link similar to the previous request, changing one
params value.
>
>or
>
><html:link name-"myform" property="map('property')">
ditto
>
>in which case what's wrong with
>
><html:link name="myForm" property="property">
ditto
--
Mike W
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: can't access DAF getMap()
Posted by Mark Lowe <ma...@talk21.com>.
This might work
<html:link name="myform.map">
or
<html:link name="myform" property="map.property">
or
<html:link name-"myform" property="map('property')">
in which case what's wrong with
<html:link name="myForm" property="property">
You've been doing this with struts tags..
<c:out value="${myForm.map}" />
Hope this helps
Mark
On Sunday, August 17, 2003, at 02:33 PM, Mike Whittaker wrote:
> Okay I've RTFM.
>
> <html:link> seems it should do the job with its populating from a map
> abilities.
>
> <html:link page="/blah.do" name="myForm" property="map" >
> TEST
> </html:link>
>
> However, I give it my DynaActionForm (with its getMap() method) and the
> property 'map' and I get:
>
> javax.servlet.ServletException: No getter method for property map of
> bean
> myForm
>
> which is really wierd, because at the same time I can do:
>
> <c:out value="${myForm.map['aParam']}" />
>
> I think it is looking for a form-property called 'map'. How do I
> access
> this method through html:link ?
>
> --
> Mike W
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org