Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
–
–
The angle bracket i.e
>
is legal inside the
if
struts tag. From the
link
shared by @rees, under the section
Appendix: OGNL Language Reference > Operators
, you can see this example:
e1 >= e2, e1 gte e2
Greater than or equals comparison
In your case:
<s:if test="%{#someVar gte 60}">Hello</s:if>
and you don't need the %{}
, as the #
sign is already telling Struts to go and find the someVar on the ActionContext
. Better still, you don't need the #
sign, if someVar is on the Value Stack
, i.e declared as a property in your Action class with getter and setter.
This does not work though:
<s:if test="%{#someVar >e; 60}">Hello</s:if>
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.