You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Meenakshi Singh <me...@mind-infotech.com> on 2005/10/13 15:23:48 UTC

How to do Multiple String comparisons Using struts tags

Hi All

I have been working with Struts Framework for some time now. However, I am
stuck with a problem.
While writing code in JSP, whenever I want to compare multiple String cases,
I can cod it as below

<%
 String s="ABC";

if(s.equals("BC")||s.equals("CD")||s.equals("ABC")){

   System.out.println("s==="+s);

}

%>

I would like to know as to how  I would be able  to code the same thing
using struts tags. The available tags that I know for the purpose are
<logic:equal ...></logic:logic> or else tags.
Would anyone please help me sort out this problem.

PS: Please give your suggestions with a code example.

Thank you  & Regards,
Meenakshi.













---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to do Multiple String comparisons Using struts tags

Posted by Kishore Senji <ki...@gmail.com>.
With logic:equal and logic:notEqual the multiple "OR" logic can be done in a
round about way, but I don't think it's recommended. Just use JSTL or use
Niall Pemberton's tag extensions

http://husted.com/struts/resources/logic-niallp.htm

On 10/13/05, Meenakshi Singh <me...@mind-infotech.com> wrote:
>
> Hi All
>
> I have been working with Struts Framework for some time now. However, I am
> stuck with a problem.
> While writing code in JSP, whenever I want to compare multiple String
> cases,
> I can cod it as below
>
> <%
> String s="ABC";
>
> if(s.equals("BC")||s.equals("CD")||s.equals("ABC")){
>
> System.out.println("s==="+s);
>
> }
>
> %>
>
> I would like to know as to how I would be able to code the same thing
> using struts tags. The available tags that I know for the purpose are
> <logic:equal ...></logic:logic> or else tags.
> Would anyone please help me sort out this problem.
>
> PS: Please give your suggestions with a code example.
>
> Thank you & Regards,
> Meenakshi.
>
>
>
>
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>