JSTL函数库和自定义函数

引入函数库

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

用法:

jstl函数库,函数调用必须在EL表达式之前,前缀+冒号+函数名 ${fn:length(hello)}

自定义函数库:

     1、定义类和方法(必须是public static)

     2、编写自定义tld文件,并且将此文件放到web-inf或子目录下

     3、引入函数库 <%@ taglib prefix=”my” uri=”http://cn.synjones.com/myfunctions”%>

原文地址:https://www.cnblogs.com/guaniu/p/2324444.html