zoukankan      html  css  js  c++  java
  • freemaker的函数使用

    如下:

    <html>
       <body>
          <div class="container">
          <h4>修改用户角色</h4>
    <#function contain userList roleTypeId>
    	<#local num=0>
    	<#list userList as userList>
    		<#if userList.roleTypeId ==roleTypeId>
    			<#local num = num +1 >
    		</#if>
    	</#list>
    	<#return num>
    </#function>
        <form role="form" method="post" action="/userManage/userRoleSave" enctype="multipart/form-data">
            <label class="label-tips" for="u">账号:</label>
            <span id="username">${(userinfo.username)!''}</span><p>
            
            <label class="label-tips" for="nickname">昵称:</label>
            <span id="nickname">${(userinfo.nickname)!''}</span><p>
                    
            <label class="label-tips" for="roles">已有角色:</label><p>
            <#list userinfo.roles as userRoleList>
            <tr>
            	<td>
            		<span id="roleName">${(userRoleList.roleTypeId)!''}.${(userRoleList.roleName)!''}&nbsp&nbsp&nbsp&nbsp</span>
            	</td>
            </tr>
            </#list><p>
    		<label class="label-tips" for="u">修改角色: </label><p>
            <#list roles as rolesList>
            	<input type="checkbox" name="roleTypeIdList" id="sexMAN" value="${(rolesList.roleTypeId)!''}"  <#if contain(userinfo.roles,rolesList.roleTypeId)==1 > checked="checked" </#if>>${(rolesList.roleTypeId)!''}.${(rolesList.roleName)!''}&nbsp&nbsp&nbsp&nbsp  			
      	</#list>
            	<input hidden type="text" name="userid" value="${(userinfo.userid)!''}"><p>
                 <input type="submit" name="修改"/>${(msg?if_exists)!''}
        </form>
        
    </div>
    
    </body>
    </html>
    

      

  • 相关阅读:
    python_基础
    大话数据结构笔记
    c语言深度剖析
    liunx 第一章
    zookeper实现分布式锁
    zookeeper图形化操作工具
    windows下zookeeper集群的搭建
    TransactionInterceptor]: Bean property 'transactionManagerBeanName' is not w
    深入浅出zookeeper(二)
    com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of
  • 原文地址:https://www.cnblogs.com/amoyzhu/p/9203346.html
Copyright © 2011-2022 走看看