File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes using logic:equal tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "using logic:equal tag" Watch "using logic:equal tag" New topic

using logic:equal tag

peter mcp

Joined: Jan 23, 2003
Posts: 8
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 ?!!!
Lalitha Chandran
Ranch Hand

Joined: Jul 03, 2003
Posts: 92
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.
if (bean.getName().equals("John"))
request.setAttribute("name", "yes")
<logic resent name="name" scope="request">
<bean:write .......(name)
</logic resent>
I am not sure if this is what you are looking for.
Lalitha Chandran
Ranch Hand

Joined: Jul 03, 2003
Posts: 92
I came across one more solution.
Sundar Narasimhan

Joined: Jul 19, 2003
Posts: 2
the simpler way to do this is
<logic:equal name="someform" property="somevalue" value='<%= request.getParameter("someparameter") %>' />
I agree. Here's the link:
subject: using logic:equal tag
It's not a secret anymore!