You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Axel Groß <ka...@iaeste.at> on 2004/03/18 12:46:41 UTC

EL buggy? this shouldn't happen

hi all!

while trying to figure out how indexed/mapped properties work I get some strange
behaviour - I'm pretty sure this doesn't conform to standard (hope I'm
mistaken):
<logic:iterate id="foo" indexId="ctr" name="mappedTest" property="testPrimKey">
  <tr>
    <td>${foo}</td>
    <td>${ctr}</td>
    <td>testPrimKey[${ctr}]</td>
  </tr>
</logic:iterate>

evaluates to:
  <tr>
    <td>k1</td>
    <td>0</td>
    <td>testPrimKey[]</td>
  </tr>
  <tr>
    <td>k2</td>
    <td>1</td>
    <td>testPrimKey[]</td>
  </tr>
  ...

where the k1, k2.. are the expected values of key "testPrimKey" in the
HashMap put under "mappedTest" in the PageContext
BUT ${ctr} gets evaluated to different values 

I'm using struts1.1 and tomcat 5.0.19
so whose wrong?
me or the result ???

thanks for enlightenment!
Axel

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: indexed property problem

Posted by Axel Groß <ka...@iaeste.at>.
went through the beanutils code to find the reason for the
ArrayIndexOutOfBounds.
found that it doesn't use my setter method, which would adjust the array
size, but just my getter method (which returns an array, which isn't big
enough); moving over to lists instead

so i suppose my html was correct.
the html:text issues are still not working anyway :/

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: indexed property problem

Posted by Axel Groß <ka...@iaeste.at>.
i was trying to figure out how to use indexed properties.
in the end I want to pass a collection of name/value pairs to the form,
which the user can edit and then check those and maybe pass the new values
to business logic.
at the moment i'm trying to do this with two String[], one called keys the
other one called values.
For passing those values to the browser, I try using indexed propertie.
As I'm not sure how it has to look like in html so that struts will
populate the ActionForm I'm stuck with the html:text tag, which I can't 
make work the way I'd like it to

testPrimKey is a String[] which should put values into the html,
which should get put into the ActionForm, which has an indexed 
property called 'keys'
so if I'm guessing right it should look in the end like
 <input type="text" value="k1" name="keys[0]" />
but if I have that i get a 

ServletException: BeanUtils.populate
..(RequestUtils.java:1254)
root cause
 ArrayIndexOutOfBoundsException
   java.lang.reflect.Aray.set(Native Method)

...
so maybe that means, the html syntax is ok; but i don't know..
:/

On 2004-03-18 at 17:17:10 +0100, Mark Lowe wrote:
> I thought you were trying to get a mapped property.
> 
> What does the structure look like? I cant see what you're drilling to.
> 
> 
> On 18 Mar 2004, at 15:23, Axel Groß wrote:
> 
> >On 2004-03-18 at 15:10:47 +0100, Mark Lowe wrote:
> >>try
> >>
> >> <html-el:text name="mappedTest" property="testPrimKey(${ctr})" />
> >doesnt exist in struts 1.1,right?
> >should be evaluated anyway...
> >i tried now
> > <html:text name="mappedTest" property='testPrimKey[0]' />
> >-> still
> > <input type="text" name="testPrimKey[0]" value="" />
> >
> >should that version work? if so it doesnt seem to be the EL part which  
> >is
> >amiss.
> >
> >>
> >>
> >>
> >>
> >>On 18 Mar 2004, at 14:49, Axel Groß wrote:
> >>
> >>>Hi Mark!
> >>>
> >>>thanks for your answer
> >>>>>  <td>testPrimKey[${ctr}]</td>
> >>>evaluates to as it should to testPrimKey[0], testPrimKey[1]..
> >>>( i did a stupid mistake in my code ),
> >>>
> >>>On 2004-03-18 at 13:25:22 +0100, Mark Lowe wrote:
> >>>>${testPrimKey[ctr]}
> >>>that actually evaluates to nothing
> >>>but ${mappedTest.testPrimKey[ctr]}
> >>>gets the right result
> >>>
> >>>BUT my original intention (to use it with html:struts) still fails,
> >>>because
> >>>the tag doesnt populate the value for the indexed property:
> >>>without using the indexed property:
> >>><html:text name="mappedTest" property='testPrimKey'></html:text>
> >>>-> is as expected:
> >>><input type="text" name="testPrimKey" value="[Ljava...{right object
> >>>reference}" />
> >>>
> >>>with using the indexed property
> >>><html:text name="mappedTest" property='testPrimKey[${ctr}]' />
> >>>-> doesnt put value attribute:
> >>><input type="text" name="testPrimKey[0]" value="" />
> >>><input type="text" name="testPrimKey[1]" value="" />
> >>>...
> >>>
> >>>if anybody could help me with that one, i'd be relieved
> >>>thanks,
> >>>axel
> >>>
> >>>>
> >>>>or perhaps with the wrappers
> >>>>
> >>>><c:set var="key" value="${testPrimKey[ctr]}" />
> >>>>${key}
> >>>>
> >>>>what does that do?
> >>>>
> >>>>
> >>>>On 18 Mar 2004, at 12:46, Axel Groß wrote:
> >>>>
> >>>>>hi all!
> >>>>>
> >>>>>while trying to figure out how indexed/mapped properties work I get
> >>>>>some strange
> >>>>>behaviour - I'm pretty sure this doesn't conform to standard (hope
> >>>>>I'm
> >>>>>mistaken):
> >>>>><logic:iterate id="foo" indexId="ctr" name="mappedTest"
> >>>>>property="testPrimKey">
> >>>>><tr>
> >>>>>  <td>${foo}</td>
> >>>>>  <td>${ctr}</td>
> >>>>>  <td>testPrimKey[${ctr}]</td>
> >>>>></tr>
> >>>>></logic:iterate>
> >>>>>
> >>>>>evaluates to:
> >>>>><tr>
> >>>>>  <td>k1</td>
> >>>>>  <td>0</td>
> >>>>>  <td>testPrimKey[]</td>
> >>>>></tr>
> >>>>><tr>
> >>>>>  <td>k2</td>
> >>>>>  <td>1</td>
> >>>>>  <td>testPrimKey[]</td>
> >>>>></tr>
> >>>>>...
> >>>>>
> >>>>>where the k1, k2.. are the expected values of key "testPrimKey" in
> >>>>>the
> >>>>>HashMap put under "mappedTest" in the PageContext
> >>>>>BUT ${ctr} gets evaluated to different values
> >>>>>
> >>>>>I'm using struts1.1 and tomcat 5.0.19
> >>>>>so whose wrong?
> >>>>>me or the result ???
> >>>>>
> >>>>>thanks for enlightenment!
> >>>>>Axel
> >>>>>
> >>>>>------------------------------------------------------------------- 
> >>>>>--
> >>>>>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
> >>>
> >>
> >>
> >>---------------------------------------------------------------------
> >>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
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: indexed property problem

Posted by Mark Lowe <ma...@talk21.com>.
I thought you were trying to get a mapped property.

What does the structure look like? I cant see what you're drilling to.


On 18 Mar 2004, at 15:23, Axel Groß wrote:

> On 2004-03-18 at 15:10:47 +0100, Mark Lowe wrote:
>> try
>>
>>  <html-el:text name="mappedTest" property="testPrimKey(${ctr})" />
> doesnt exist in struts 1.1,right?
> should be evaluated anyway...
> i tried now
>  <html:text name="mappedTest" property='testPrimKey[0]' />
> -> still
>  <input type="text" name="testPrimKey[0]" value="" />
>
> should that version work? if so it doesnt seem to be the EL part which  
> is
> amiss.
>
>>
>>
>>
>>
>> On 18 Mar 2004, at 14:49, Axel Groß wrote:
>>
>>> Hi Mark!
>>>
>>> thanks for your answer
>>>>>   <td>testPrimKey[${ctr}]</td>
>>> evaluates to as it should to testPrimKey[0], testPrimKey[1]..
>>> ( i did a stupid mistake in my code ),
>>>
>>> On 2004-03-18 at 13:25:22 +0100, Mark Lowe wrote:
>>>> ${testPrimKey[ctr]}
>>> that actually evaluates to nothing
>>> but ${mappedTest.testPrimKey[ctr]}
>>> gets the right result
>>>
>>> BUT my original intention (to use it with html:struts) still fails,
>>> because
>>> the tag doesnt populate the value for the indexed property:
>>> without using the indexed property:
>>> <html:text name="mappedTest" property='testPrimKey'></html:text>
>>> -> is as expected:
>>> <input type="text" name="testPrimKey" value="[Ljava...{right object
>>> reference}" />
>>>
>>> with using the indexed property
>>> <html:text name="mappedTest" property='testPrimKey[${ctr}]' />
>>> -> doesnt put value attribute:
>>> <input type="text" name="testPrimKey[0]" value="" />
>>> <input type="text" name="testPrimKey[1]" value="" />
>>> ...
>>>
>>> if anybody could help me with that one, i'd be relieved
>>> thanks,
>>> axel
>>>
>>>>
>>>> or perhaps with the wrappers
>>>>
>>>> <c:set var="key" value="${testPrimKey[ctr]}" />
>>>> ${key}
>>>>
>>>> what does that do?
>>>>
>>>>
>>>> On 18 Mar 2004, at 12:46, Axel Groß wrote:
>>>>
>>>>> hi all!
>>>>>
>>>>> while trying to figure out how indexed/mapped properties work I get
>>>>> some strange
>>>>> behaviour - I'm pretty sure this doesn't conform to standard (hope
>>>>> I'm
>>>>> mistaken):
>>>>> <logic:iterate id="foo" indexId="ctr" name="mappedTest"
>>>>> property="testPrimKey">
>>>>> <tr>
>>>>>   <td>${foo}</td>
>>>>>   <td>${ctr}</td>
>>>>>   <td>testPrimKey[${ctr}]</td>
>>>>> </tr>
>>>>> </logic:iterate>
>>>>>
>>>>> evaluates to:
>>>>> <tr>
>>>>>   <td>k1</td>
>>>>>   <td>0</td>
>>>>>   <td>testPrimKey[]</td>
>>>>> </tr>
>>>>> <tr>
>>>>>   <td>k2</td>
>>>>>   <td>1</td>
>>>>>   <td>testPrimKey[]</td>
>>>>> </tr>
>>>>> ...
>>>>>
>>>>> where the k1, k2.. are the expected values of key "testPrimKey" in
>>>>> the
>>>>> HashMap put under "mappedTest" in the PageContext
>>>>> BUT ${ctr} gets evaluated to different values
>>>>>
>>>>> I'm using struts1.1 and tomcat 5.0.19
>>>>> so whose wrong?
>>>>> me or the result ???
>>>>>
>>>>> thanks for enlightenment!
>>>>> Axel
>>>>>
>>>>> ------------------------------------------------------------------- 
>>>>> --
>>>>> 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
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: indexed property problem

Posted by Axel Groß <ka...@iaeste.at>.
On 2004-03-18 at 15:10:47 +0100, Mark Lowe wrote:
> try
> 
>  <html-el:text name="mappedTest" property="testPrimKey(${ctr})" />
doesnt exist in struts 1.1,right?
should be evaluated anyway...
i tried now
 <html:text name="mappedTest" property='testPrimKey[0]' />
-> still
 <input type="text" name="testPrimKey[0]" value="" />
 
should that version work? if so it doesnt seem to be the EL part which is
amiss.

> 
> 
> 
> 
> On 18 Mar 2004, at 14:49, Axel Groß wrote:
> 
> >Hi Mark!
> >
> >thanks for your answer
> >>>   <td>testPrimKey[${ctr}]</td>
> >evaluates to as it should to testPrimKey[0], testPrimKey[1]..
> >( i did a stupid mistake in my code ),
> >
> >On 2004-03-18 at 13:25:22 +0100, Mark Lowe wrote:
> >>${testPrimKey[ctr]}
> >that actually evaluates to nothing
> >but ${mappedTest.testPrimKey[ctr]}
> >gets the right result
> >
> >BUT my original intention (to use it with html:struts) still fails, 
> >because
> >the tag doesnt populate the value for the indexed property:
> >without using the indexed property:
> > <html:text name="mappedTest" property='testPrimKey'></html:text>
> >-> is as expected:
> > <input type="text" name="testPrimKey" value="[Ljava...{right object 
> >reference}" />
> >
> >with using the indexed property
> > <html:text name="mappedTest" property='testPrimKey[${ctr}]' />
> >-> doesnt put value attribute:
> > <input type="text" name="testPrimKey[0]" value="" />
> > <input type="text" name="testPrimKey[1]" value="" />
> > ...
> >
> >if anybody could help me with that one, i'd be relieved
> >thanks,
> >axel
> >
> >>
> >>or perhaps with the wrappers
> >>
> >><c:set var="key" value="${testPrimKey[ctr]}" />
> >>${key}
> >>
> >> what does that do?
> >>
> >>
> >>On 18 Mar 2004, at 12:46, Axel Groß wrote:
> >>
> >>>hi all!
> >>>
> >>>while trying to figure out how indexed/mapped properties work I get
> >>>some strange
> >>>behaviour - I'm pretty sure this doesn't conform to standard (hope 
> >>>I'm
> >>>mistaken):
> >>><logic:iterate id="foo" indexId="ctr" name="mappedTest"
> >>>property="testPrimKey">
> >>> <tr>
> >>>   <td>${foo}</td>
> >>>   <td>${ctr}</td>
> >>>   <td>testPrimKey[${ctr}]</td>
> >>> </tr>
> >>></logic:iterate>
> >>>
> >>>evaluates to:
> >>> <tr>
> >>>   <td>k1</td>
> >>>   <td>0</td>
> >>>   <td>testPrimKey[]</td>
> >>> </tr>
> >>> <tr>
> >>>   <td>k2</td>
> >>>   <td>1</td>
> >>>   <td>testPrimKey[]</td>
> >>> </tr>
> >>> ...
> >>>
> >>>where the k1, k2.. are the expected values of key "testPrimKey" in 
> >>>the
> >>>HashMap put under "mappedTest" in the PageContext
> >>>BUT ${ctr} gets evaluated to different values
> >>>
> >>>I'm using struts1.1 and tomcat 5.0.19
> >>>so whose wrong?
> >>>me or the result ???
> >>>
> >>>thanks for enlightenment!
> >>>Axel
> >>>
> >>>---------------------------------------------------------------------
> >>>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
> >
> 
> 
> ---------------------------------------------------------------------
> 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: indexed property problem

Posted by Mark Lowe <ma...@talk21.com>.
try

  <html-el:text name="mappedTest" property="testPrimKey(${ctr})" />




On 18 Mar 2004, at 14:49, Axel Groß wrote:

> Hi Mark!
>
> thanks for your answer
>>>    <td>testPrimKey[${ctr}]</td>
> evaluates to as it should to testPrimKey[0], testPrimKey[1]..
> ( i did a stupid mistake in my code ),
>
> On 2004-03-18 at 13:25:22 +0100, Mark Lowe wrote:
>> ${testPrimKey[ctr]}
> that actually evaluates to nothing
> but ${mappedTest.testPrimKey[ctr]}
> gets the right result
>
> BUT my original intention (to use it with html:struts) still fails, 
> because
> the tag doesnt populate the value for the indexed property:
> without using the indexed property:
>  <html:text name="mappedTest" property='testPrimKey'></html:text>
> -> is as expected:
>  <input type="text" name="testPrimKey" value="[Ljava...{right object 
> reference}" />
>
> with using the indexed property
>  <html:text name="mappedTest" property='testPrimKey[${ctr}]' />
> -> doesnt put value attribute:
>  <input type="text" name="testPrimKey[0]" value="" />
>  <input type="text" name="testPrimKey[1]" value="" />
>  ...
>
> if anybody could help me with that one, i'd be relieved
> thanks,
> axel
>
>>
>> or perhaps with the wrappers
>>
>> <c:set var="key" value="${testPrimKey[ctr]}" />
>> ${key}
>>
>>  what does that do?
>>
>>
>> On 18 Mar 2004, at 12:46, Axel Groß wrote:
>>
>>> hi all!
>>>
>>> while trying to figure out how indexed/mapped properties work I get
>>> some strange
>>> behaviour - I'm pretty sure this doesn't conform to standard (hope 
>>> I'm
>>> mistaken):
>>> <logic:iterate id="foo" indexId="ctr" name="mappedTest"
>>> property="testPrimKey">
>>>  <tr>
>>>    <td>${foo}</td>
>>>    <td>${ctr}</td>
>>>    <td>testPrimKey[${ctr}]</td>
>>>  </tr>
>>> </logic:iterate>
>>>
>>> evaluates to:
>>>  <tr>
>>>    <td>k1</td>
>>>    <td>0</td>
>>>    <td>testPrimKey[]</td>
>>>  </tr>
>>>  <tr>
>>>    <td>k2</td>
>>>    <td>1</td>
>>>    <td>testPrimKey[]</td>
>>>  </tr>
>>>  ...
>>>
>>> where the k1, k2.. are the expected values of key "testPrimKey" in 
>>> the
>>> HashMap put under "mappedTest" in the PageContext
>>> BUT ${ctr} gets evaluated to different values
>>>
>>> I'm using struts1.1 and tomcat 5.0.19
>>> so whose wrong?
>>> me or the result ???
>>>
>>> thanks for enlightenment!
>>> Axel
>>>
>>> ---------------------------------------------------------------------
>>> 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
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


indexed property problem

Posted by Axel Groß <ka...@iaeste.at>.
Hi Mark!

thanks for your answer
> >    <td>testPrimKey[${ctr}]</td>
evaluates to as it should to testPrimKey[0], testPrimKey[1]..
( i did a stupid mistake in my code ),

On 2004-03-18 at 13:25:22 +0100, Mark Lowe wrote:
> ${testPrimKey[ctr]}
that actually evaluates to nothing
but ${mappedTest.testPrimKey[ctr]}
gets the right result

BUT my original intention (to use it with html:struts) still fails, because
the tag doesnt populate the value for the indexed property:
without using the indexed property:
 <html:text name="mappedTest" property='testPrimKey'></html:text>
-> is as expected:
 <input type="text" name="testPrimKey" value="[Ljava...{right object reference}" />

with using the indexed property
 <html:text name="mappedTest" property='testPrimKey[${ctr}]' />
-> doesnt put value attribute:
 <input type="text" name="testPrimKey[0]" value="" /> 
 <input type="text" name="testPrimKey[1]" value="" /> 
 ...

if anybody could help me with that one, i'd be relieved
thanks,
axel

> 
> or perhaps with the wrappers
> 
> <c:set var="key" value="${testPrimKey[ctr]}" />
> ${key}
> 
>  what does that do?
> 
> 
> On 18 Mar 2004, at 12:46, Axel Groß wrote:
> 
> >hi all!
> >
> >while trying to figure out how indexed/mapped properties work I get 
> >some strange
> >behaviour - I'm pretty sure this doesn't conform to standard (hope I'm
> >mistaken):
> ><logic:iterate id="foo" indexId="ctr" name="mappedTest" 
> >property="testPrimKey">
> >  <tr>
> >    <td>${foo}</td>
> >    <td>${ctr}</td>
> >    <td>testPrimKey[${ctr}]</td>
> >  </tr>
> ></logic:iterate>
> >
> >evaluates to:
> >  <tr>
> >    <td>k1</td>
> >    <td>0</td>
> >    <td>testPrimKey[]</td>
> >  </tr>
> >  <tr>
> >    <td>k2</td>
> >    <td>1</td>
> >    <td>testPrimKey[]</td>
> >  </tr>
> >  ...
> >
> >where the k1, k2.. are the expected values of key "testPrimKey" in the
> >HashMap put under "mappedTest" in the PageContext
> >BUT ${ctr} gets evaluated to different values
> >
> >I'm using struts1.1 and tomcat 5.0.19
> >so whose wrong?
> >me or the result ???
> >
> >thanks for enlightenment!
> >Axel
> >
> >---------------------------------------------------------------------
> >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: EL buggy? this shouldn't happen

Posted by Mark Lowe <ma...@talk21.com>.
${testPrimKey[ctr]}

or perhaps with the wrappers

<c:set var="key" value="${testPrimKey[ctr]}" />
${key}

  what does that do?


On 18 Mar 2004, at 12:46, Axel Groß wrote:

> hi all!
>
> while trying to figure out how indexed/mapped properties work I get 
> some strange
> behaviour - I'm pretty sure this doesn't conform to standard (hope I'm
> mistaken):
> <logic:iterate id="foo" indexId="ctr" name="mappedTest" 
> property="testPrimKey">
>   <tr>
>     <td>${foo}</td>
>     <td>${ctr}</td>
>     <td>testPrimKey[${ctr}]</td>
>   </tr>
> </logic:iterate>
>
> evaluates to:
>   <tr>
>     <td>k1</td>
>     <td>0</td>
>     <td>testPrimKey[]</td>
>   </tr>
>   <tr>
>     <td>k2</td>
>     <td>1</td>
>     <td>testPrimKey[]</td>
>   </tr>
>   ...
>
> where the k1, k2.. are the expected values of key "testPrimKey" in the
> HashMap put under "mappedTest" in the PageContext
> BUT ${ctr} gets evaluated to different values
>
> I'm using struts1.1 and tomcat 5.0.19
> so whose wrong?
> me or the result ???
>
> thanks for enlightenment!
> Axel
>
> ---------------------------------------------------------------------
> 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


[SOLVED] - my fault - Re: EL buggy? this shouldn't happen

Posted by Axel Groß <ka...@iaeste.at>.
sorry!
in my code (on the other machine), 
I reference once the not existing EL variable crt
so the code i posted works as expected

sorry again :(( (should have taken a break)
regards,
Axel

On 2004-03-18 at 12:46:41 +0100, Axel Groß wrote:
> hi all!
> 
> while trying to figure out how indexed/mapped properties work I get some strange
> behaviour - I'm pretty sure this doesn't conform to standard (hope I'm
> mistaken):
> <logic:iterate id="foo" indexId="ctr" name="mappedTest" property="testPrimKey">
>   <tr>
>     <td>${foo}</td>
>     <td>${ctr}</td>
>     <td>testPrimKey[${ctr}]</td>
>   </tr>
> </logic:iterate>
> 
> evaluates to:
>   <tr>
>     <td>k1</td>
>     <td>0</td>
>     <td>testPrimKey[]</td>
>   </tr>
>   <tr>
>     <td>k2</td>
>     <td>1</td>
>     <td>testPrimKey[]</td>
>   </tr>
>   ...
> 
> where the k1, k2.. are the expected values of key "testPrimKey" in the
> HashMap put under "mappedTest" in the PageContext
> BUT ${ctr} gets evaluated to different values 
> 
> I'm using struts1.1 and tomcat 5.0.19
> so whose wrong?
> me or the result ???
> 
> thanks for enlightenment!
> Axel
> 
> ---------------------------------------------------------------------
> 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