aspose file tools*
The moose likes Struts and the fly likes how to compare two variables in struts logic:equal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to compare two variables in struts logic:equal" Watch "how to compare two variables in struts logic:equal" New topic
Author

how to compare two variables in struts logic:equal

zimbu bolleddu
Ranch Hand

Joined: Jan 14, 2008
Posts: 35
Hi all,

I'm new to struts,

how to compare two variables in <logic:equal > tag.

variables something like : <% var1 %> and <% var2 %>.

please give me an example...!

Thanks in advance
Suresh Kumar
Greenhorn

Joined: May 26, 2008
Posts: 6
Hi,

For comparing two request parameters, you can use

<logic:equal parameter="password" value="${ param.userName }">
Hi User, Thanks for visiting!!!
</logic:equal>

You can also compare attributes of a bean against constant values/rumtime expressions.

<logic:equal name="loginForm" property="username" value="user001">
Hi user001, Thanks for visiting!!!
</logic:equal>

Hope it is useful.

Suresh.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to compare two variables in struts logic:equal