struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tom tom <j_lal...@yahoo.com>
Subject Re: Has anyone tried this in S2 - THIS LOOKS A BUG
Date Mon, 02 Jul 2007 00:23:31 GMT
I did further investigation,
I think this is a bug, I think this is a very scary
bug.

You dont need three iterators, I could reproduce this
very easily,

In your action class have the following,

 String[] testArray = new String[5];
             
             testArray[0]="test0";
             testArray[1]="test1";
             testArray[2]="test2";
             testArray[3]="test";
            
             
session.setAttribute("testArray",testArray);


 In your jsp have the following


<s:iterator value="#session.testArray" id="testarr">
  Value of the arry is
  <s:property value="#testarr"/>
  <br> 
 </s:iterator>


WHAT it prints is following Issue is for the 4th index
also it prints test, it should print empty

Value of the arry is test0
Value of the arry is test1
Value of the arry is test2
Value of the arry is test
Value of the arry is test 


This is a scary behaviour for me,

Has anyone reported this bug, Any JIRA issue raised.

Thanks












--- Ian Roughley <ian@fdar.com> wrote:

> Take a look at the value stack via the debug tag. 
> 
> Usually the property tag will keep stepping through
> the value stack 
> until a getter for the property is found (the object
> for the current 
> iteration is placed on the top of the value stack). 
> Although, if you 
> are explicitly defining the object (via id and
> #test) there shouldn't be 
> a problem. 
> 
> /Ian
> 
> tom tom wrote:
> 
> >Hi,
> >
> >I got three iterations which I tried as below in
> the
> >jsp, First two and Array of certain DTO and last
> >iterator is a String array. There is no jsp
> >compilation error, but the issue is it produced
> >misleading results.
> >
> >Is there any limitation in S2 for the depth of the
> >iteration. Is this way of using recommended?
> >
> >Sometimes where it is suppose to print empty value
> it
> >prints something else (looks like from the previous
> >iterator)
> >
> ><s:iterator value="#session.ITER1" id="qnn">
> >....
> >....
> ><s:iterator value="#qnn.ITER2" id="qa">
> >....
> >....
> > <s:iterator value="#qa.ITER3" id="test">
> >   <s:property value="#test" />
> ></s:iterator> 
> >
> ></s:iterator> 
> >
> ></s:iterator> 
> >
> >
> >
> >     
>
____________________________________________________________________________________
> >Park yourself in front of a world of choices in
> alternative vehicles. Visit the Yahoo! Auto Green
> Center.
> >http://autos.yahoo.com/green_center/ 
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >  
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 



 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html

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


Mime
View raw message