• 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

struts:logic

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
in the follwing code
<logic:greaterThan name="user" property="age"
value="<%=minAge%>">
you are over min age<%=minAge%>
</logic:greaterThan>

in this we test the age data member of the scripting variable user. If this data member is greater than the value stored in the scripting variable minAge, then the tag's body will be evaluated.

here the scripting variable user means is it an normal variable or it should be between <%%> what this scripting variable means

Thanks in advance
saiprasanna
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wouldn't use the term "scripting variable" for "user". In this case, "user" is a javabean in some scope (Application, Session, Request, or Page) and age is a property of that javaBean. Since the <logic:greaterThan> tag defines the name and property as expecting the name of a java bean and it's property, neither one has to be enclosed in <%=%>. The value property, on the other hand, is expected to be either a literal or a run-time expression. So, if we can't specify something static like value="30", then we have to use a scriptlet such as <%=minAge%> to represent the number.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic