I guess my problem is larger than using an if/else statement. I figured how to do that, but I'm iterating over a List in the JSP, and want to be able to exit the loop whenever certain item exist. I don't suppose there's a way to do that, is there? My requirement in a nutshell: the List could have role1, role2, and role3. But I can only print one role on the screen. If the list has multiple roles, then my loop will show all of them. I want to be able to exit the loop after I find the role that I'm looking for. Philihp Busby <[EMAIL PROTECTED]> wrote: Jerome is referring to tags in the JSTL Core tag library.
mmm code-bloat. On 5/14/06, J Gotsch wrote: > Which package does this belong to? I can't find it anywhere. > > Jerome Gagner wrote: > use > > On 5/13/06, J Gotsch wrote: > > Hello All, > > > > How do I perform an If/else with ? > > > > In the below logic:iterate tag, If my collection contains both ROLE1 AND > > ROLE2, Then both statements will be displayed. And that's now what I want. > > > > I want to implement something like this: > > > > if(securityRoleName.equals("ROLE1")) > > // print You have ROLE1 ! > > else if (securityRoleName.equals("ROLE1")) > > //print You have ROLE2 ! > > else > > //print you have NO ROLE! > > > > This is what I have now: > > > > > property="xyz" scope="session"> > > > > > property="securityRoleName" value="ROLE1"> > > You have ROLE1 ! > > > > > property="securityRoleName" value="ROLE2"> > > You have ROLE1 ! > > > > > property="securityRoleName"> > > You have no ROLE! > > > > > > > > > > > > --------------------------------- > > Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! > > Messenger with Voice. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------- > Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2¢/min > with Yahoo! Messenger with Voice. > --------------------------------- Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2¢/min with Yahoo! Messenger with Voice.