Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to compare two variables in struts logic:equal

 
zimbu bolleddu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic