在hibernate里面${}取出来的字段如何截取字符串,用substring不行,急用,请指点下啊,,,,
就是我查询所有,返回的是list,在页面里取${list.content},但在页面显示的要截取这个字段。
------解决方案--------------------
- HTML code
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%><c:choose><c:when test="${fn:length(list.content) gt 25}"> ${fn:substring(data.actName,0,25)}... </c:when><c:otherwise> ${list.content}</c:otherwise></c:choose>