编写EL函数
来源:互联网 发布:工商总局打击网络传销 编辑:程序博客网 时间:2024/06/01 07:12
一般来说,创建一个EL函数要遵循两个步骤
1.创建一个包含静态方法的public类
2.利用function元素在tld里面注册函数
静态方法的类:
public class EL { public static String reverseString(String s){ return new StringBuffer(s).reverse().toString(); }}
注册:
<?xml version="1.0" encoding="ISO-8859-1"?><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/web-jsptaglibrary_2_0.xsd" verson="2.0"> <description>Function tag example</description> <tlib-version>1.0</tlib-version> <jspversion>2.3</jspversion> <function> <description>Reverse a String</description> <name>reverseString</name> <function-class>tag.EL</function-class> <function-signature> java.lang.String reverseString(java.lang.String) </function-signature> </function></taglib>
使用:
结果:
阅读全文
0 0
- 编写EL函数
- 编写 EL 自定义函数 的方法
- 黑马day06 张孝祥老师编写的EL函数标签库
- el函数
- EL函数
- toGBK(使用EL函数)
- 如何自定义EL函数
- el fn函数收藏
- EL自定义函数
- el 截取fn函数
- EL表达式常用函数
- el自定义函数
- JSP自定义EL函数
- EL自定义函数
- 自定义EL函数
- EL表达式调用函数
- EL表达式-自定义函数
- EL 表达式中的函数
- 快速排序
- 加载DQL数据源某某配置发生错误
- 桥模式VS适配器
- 小木棍
- 贪心算法
- 编写EL函数
- 敏捷开发中的问题
- Gulp Stream分析
- 2017百度之星资格赛1004度度熊的午饭时光
- POJ 1013 Counterfeit Dollar 找假硬币 模拟
- CC2640R2F BLE5.0 CC2640R2F增加一个具有通知属性的characteristic
- com:向对象到面向服务
- org.apache.commons.lang3功能示例
- 打印一个字符串的所有排列。