zoukankan      html  css  js  c++  java
  • 使用fn函数控制页面显示内容

    在使用EL的时候,不可避免的遇到,截取字符串,判断字符串长度等情况。这里给出简单的通过fn函数操作字符串的deamon。

    1、页面引入标签

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

     2、对内容的处理

    <c:choose><c:when test='${fn:length(dutyLog.content) >= 100}'>${fn:substring(dutyLog.content,0,100)}...</c:when><c:otherwise>${dutyLog.content}</c:otherwise></c:choose>
     ${fn:length(dutyLog.content)}获取dutyLog.content的对应长度;
    ${fn:substring(dutyLog.content,0,100)}截取dutyLog.content的长度,${fn:substring(str,beg,end)}

    特此记录,以待下次使用。

    人生苦短,我用python
  • 相关阅读:
    hdu-1114
    hdu2546
    POJ-3126
    POJ-1915
    ZOJ-1709
    Codeforces 847H
    Codeforces 847C
    Codeforces 847I
    Codeforces 847E
    算法笔记--矩阵及矩阵快速幂
  • 原文地址:https://www.cnblogs.com/pigga/p/10098275.html
Copyright © 2011-2022 走看看