struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john lee <sh_thorn_b...@yahoo.com>
Subject s:if iterator session problem
Date Tue, 19 Nov 2013 01:36:25 GMT
 
from the following output,
       we can tell sell_price=36.97, display_price=1
 
why
       none of test statement works ? 
 
 
please advise, thanks in advance
 
john
  
 
 
Class Part {
                float sell_price;
                int display_price;
                ./*..get set here ....*/
 
Action.java 
         Part part=new Part();
         ...../* doing some calculation */
         session.put("detailpart",part);
 
JSP file
        <s:iterator id="part" value="#session.detailpart">
                 why<s:property value="sell_price"/>- <s:property
value="display_price"/>why
                
             <s:if test='%{#part.display_price==1}'>
                                 9<s:property value="sell_price"/>9
             </s:if>
             
            <s:if test='#part.display_price==1'>
                                8<s:property value="sell_price"/>8
              </s:if>
               
              <s:if test='part.display_price==1'>
                                 7<s:property value="sell_price"/>7
              </s:if>
              
               <s:if test='%{#display_price==1}'>
                                6<s:property value="sell_price"/>6
               </s:if>     
               
               <s:if test='#display_price==1'>
                                 5<s:property value="sell_price"/>5
               </s:if>
              end
        </s:iterator>
 
OutPut
                   
 
why 36.97- 1 why                                                                         
                                                                                         
                                                end
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message