sponsored links

freemarker 与字符串的比较

<#if item.userGender == "1">
   <select name="userGender">
   <option value="1" selected>男</option>
<option value="2">女</option>

</select>
<#else>

<select name="userGender">
    <option value="1">男</option>
    <option value="2" selected>女</option>
    
   </select>
     </#if>

所以上面用到了 ""表示字符串.否则直接报error.

Tags: freemarker