• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to test property value in <s:if> tag

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a iterator tag which iterate on a list say Employees. Employees list contains object of Class Employee. Employee class has a boolean field resigned. I have a condition on resigned attribute say if resigned == true then show employee resigned details and if resigned == false then i need to show employee details.

How to evaluate the property value ?.

<s:iterator value="myList">
<s:if test="<s:property value="resigned">" == 'true'>
do some calculation
</s:if>
<s:else>
do some calculation
</s:else>
</s:iterator>

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.

You can't nest tags like that; that's not valid JSP. Have you read the Struts 2 documentation? Particularly regarding OGNL and how to use expressions in the S2 tags?(If it's actually a boolean as you said in the first paragraph, which your code contradicted.)
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys,
I was just passing by and some remarks got my attention and make me stop right here.
I would love to tell you that for us to help someone out with questions, doubts or whatever it is, it is not necessary to humiliate people for something they might do wrong.
We are all technical people and we all can make mistakes. So I suggest you next time we help someone out in this forum to do it with respect.


Sincerely

Douglas
 
reply
    Bookmark Topic Watch Topic
  • New Topic