jsp中的fn标签的使用

1,在jsp页面导入<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
2,在需要截取长度的内容写,如果需要加. . .的话那么就做判断。
<c:if test="${fn:length(SHI.video_name)>25 }">
${fn:substring(SHI.video_name,0,25)}...
</c:if>
<c:if test="${fn:length(SHI.video_name)<=25 &&fn:length(SHI.video_name)>0}">
${SHI.video_name}
</c:if>
如果不需要加的话:直接写截取内容   ${fn:substring(SHI.video_name , 0, 25)}

猜你喜欢

转载自caichenglong.iteye.com/blog/2259757