c:if test with dynamic variable

H

harshjain.cs

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
 
D

Daniel Pitts

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top