Solata
Solata

Reputation: 1482

How to test jsp attribute type

I have Spring MVC app with user settings. Settings are objects with strings Name, Value, User and Type field. To edit values form with table is generated and Values are editable strings.

For Settings that have value checkbox in field Type, I would like display checkbox, ie:

<c:if test="setting.type=='checkbox'">
   <form:checkbox path="setting.name" />
</c:if>

I cannot figure it out. Any suggestions?

Upvotes: 1

Views: 402

Answers (2)

blue_diamond
blue_diamond

Reputation: 65

Did you try ? :

<c:if test="${setting.type=='checkbox'}">
   <form:checkbox path="setting.name" /> 
</c:if>

Upvotes: 1

Kent
Kent

Reputation: 195039

did you try to change

<c:if test="setting.type=='checkbox'">

to

<c:if test="${setting.type=='checkbox'}">

?

of course, the 'setting' object must be passed to jsp correctly.

Upvotes: 3

Related Questions