自定义JSTL函数库
来源:互联网 发布:淘宝网四海认证钓具 编辑:程序博客网 时间:2024/05/20 02:26
1.新建tld文件
<?xml version="1.0" encoding="UTF-8" ?><taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0"> <description>JSTL 1.1 functions library</description> <display-name>JSTL functions</display-name> <tlib-version>1.1</tlib-version> <short-name>myfunction</short-name> <uri>http://www.funch.xin</uri> <function> <name>getClassifybyId</name> <function-class>priv.dongyukai.funch.dao.ClassifyDao</function-class> <function-signature>java.lang.String getClassifybyId(java.lang.String)</function-signature> </function></taglib>
- short-name: 函数库名
- uri: 验证地址
- name: 函数名
- function-class:类路径
- function-signature: [返回值] 方法名 ([参数])
注:返回值和参数类型为全路径(如 String 为 java.lang.String),方法比须为 static!
2.引用库
<%@ taglib prefix="myfunction" uri="http://www.funch.xin"%>
3.调用函数
<c:set var="cid" value="${article.classifyId}"/> ${myfunction:getClassifybyId(cid)}
阅读全文
1 0
- jstl函数库及自定义函数库
- jstl函数库及自定义函数库
- jstl 自定义函数库
- JSTL 自定义函数库
- JSTL 自定义函数库
- 自定义JSTL函数库
- JSTL自定义函数库的实现
- 自定义JSTL标签库(函数库)
- JSTL函数库
- JSTL自定义函数库的快捷配置与应用
- Jstl的函数库
- jstl的函数库
- Jstl的函数库
- jstl函数库-length函数
- 【JSTL】fn函数库
- JSTL -- fn函数库
- 自定义函数库
- 自定义函数库
- ThreadLocal线程范围内的共享变量
- 四 大数据分析之 SVD理论
- xdoj 1024 简单逆序对
- SSH与SSM学习之hibernate25——批量抓取
- 关于thinkphp5中model中的hasOne函数的参数说明
- 自定义JSTL函数库
- linux下opencv的交叉编译注意事项
- Linux错误:supervisor:/tmp/unix.sock can't find
- spring-cloud-zuul之spring-cloud-1.3.4(Dalston.SR3)-boot(1.5.6) 学习笔记
- 如何彻底卸载Jenkins(Windows版本)
- NOIP2007提高组 矩阵取数
- 电力系统潮流方程雅克比矩阵奇异解释
- 通过Rancher部署K8S后dashboard面板无法进入的解决办法
- Android计步器小Demo