velocity 字符串解析

来源:互联网 发布:淘宝的拍卖玉器可信吗 编辑:程序博客网 时间:2024/05/26 14:09
#if($!{olymList} && $!{olymList.size()}>0)
            #set($num = 0)
            #foreach($!{record} in $!{olymList})
                #set($num = $num+1)
                   #set($gold=$record.medal_num.substring(0,$record.medal_num.indexOf('#')))
                   
                #set($strr=$record.medal_num)
                   #set($silver=$strr.substring($gold.length(),5))
                   #set($strr=$strr.replace("$gold$silver#",""))
                   #set($silver=$silver.substring(1,$silver.length()))
                   
                   #set($copper=$strr.substring(0,$strr.indexOf('#')))
                   
                   #set($all=$record.medal_num.replace("$gold#$silver#$copper#",""))
                <tr height="32">
                <td><span>$!{num}</span></td>
                <td>$!{record.country}</td>
                <td>$!{gold}</td>
                <td>$!{silver}</td>
                <td>$!{copper}</td>
                <td>$!{all}</td>
            </tr>
            #end
        #end
原创粉丝点击