• 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

using logic:equal tag

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am trying to use the logic:equal tag to only display the properties of a bean if a specified property of the bean is equal to a request parameter.
any ideas anyone please ?!!!
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Your question doesn't seem clear enough. But from what I understand:
If suppose you want to display name property of the bean only if it is equal to say "John"(you know this value only in the action file), check this out in the action itself and set an attribute "name".
And in the jsp use logic resent for the attribute name.
Example
Action
if (bean.getName().equals("John"))
request.setAttribute("name", "yes")
JSP
<logic resent name="name" scope="request">
<bean:write .......(name)
</logic resent>
I am not sure if this is what you are looking for.
Lalitha
 
Lalitha Chandran
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I came across one more solution.
Lalitha
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the simpler way to do this is
<logic:equal name="someform" property="somevalue" value='<%= request.getParameter("someparameter") %>' />
 
reply
    Bookmark Topic Watch Topic
  • New Topic