c:if test with dynamic variable

Discussion in 'Java' started by harshjain.cs@gmail.com, Mar 22, 2007.

  1. Guest

    Hi Guyz,

    I have a set of variable that I am generating. For example xyz_1,
    xyz_2, xyz_3 and I want to test if these variable are passed as param

    how would i write a c:if statement such that it changes the variable
    name in loop.

    forexample.. something like.
    <c:if test="${not empty param.$var}"/>
    where var generates xyz_1, xyz_2,xyz,_3 .. and so on.

    Kindly let me know.

    Thanks,
    Hj
     
    , Mar 22, 2007
    #1
    1. Advertising

  2. Daniel Pitts Guest

    On Mar 22, 11:40 am, "" <>
    wrote:
    > Hi Guyz,
    >
    > I have a set of variable that I am generating. For example xyz_1,
    > xyz_2, xyz_3 and I want to test if these variable are passed as param
    >
    > how would i write a c:if statement such that it changes the variable
    > name in loop.
    >
    > forexample.. something like.
    > <c:if test="${not empty param.$var}"/>
    > where var generates xyz_1, xyz_2,xyz,_3 .. and so on.
    >
    > Kindly let me know.
    >
    > Thanks,
    > Hj


    You could try: <c:if test="${not empty param[var]}"> </c:if>
     
    Daniel Pitts, Mar 22, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris
    Replies:
    1
    Views:
    671
    Chris
    May 11, 2006
  2. Skybuck Flying

    Call oddities: &Test() vs &Test vs Test

    Skybuck Flying, Oct 4, 2009, in forum: C Programming
    Replies:
    1
    Views:
    712
    Skybuck Flying
    Oct 4, 2009
  3. Chris

    how to pass a variable from test.aspx.vb to test.aspx

    Chris, May 11, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    592
  4. Peter Buckley
    Replies:
    5
    Views:
    202
    matt neuburg
    Feb 27, 2009
  5. Vmusic
    Replies:
    6
    Views:
    133
Loading...

Share This Page