Java_JSTL_extend function tags
来源:互联网 发布:sql删除一个月前数据 编辑:程序博客网 时间:2024/05/21 17:57
1.create the function class
package cn.com.benyoyo.manage.core.common.tools;
public class ElExFuncs {
public static int lastIndexOf(String text, String searchString) {
if (text == null) text = "";
if (searchString == null) searchString = "";
return text.lastIndexOf(searchString);
}
}
2. create tld file
<?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>A extend JSTL 1.1 functions library for cmis</description>
<display-name>JSTL extend functions</display-name>
<tlib-version>1.1</tlib-version>
<short-name>fn-ex</short-name>
<function>
<description>Returns the index withing a string of the last occurrence of a specified substring.</description>
<name>lastIndexOf</name>
<function-class>cn.com.benyoyo.manage.core.common.tools.ElExFuncs</function-class>
<function-signature>int lastIndexOf(java.lang.String, java.lang.String)</function-signature>
<example>
${fn:lastIndexOf(name, "-")}
</example>
</function>
</taglib>
3.import taglib in jsp
<%@ taglib prefix="fnex" uri="/WEB-INF/config/tld/fn-ex.tld"%>
- Java_JSTL_extend function tags
- JavaScript function scope between script tags
- tags
- AJAX Tags
- 关于tags
- 什么是Tags?
- 什么是Tags?
- phpDocumentor - tags
- Bean:Tags
- SOME TAGS
- XHTML Tags
- 标记(Tags)
- Decorator Tags
- tags.tld
- tags-vim
- iterator tags
- 生成tags
- JSP Tags
- 10个调试和排错的小建议
- protobuf-cpp-3.2.0编译Windows的libprotobuf.lib
- ajax使用回调函数的例子(原生代码和jquery代码)
- setOnTouchEvent 设置返回值为true 和 false的区别
- iar error
- Java_JSTL_extend function tags
- 关系代数
- 网络通信之htonl()、htons()、ntohl()、ntohs()四个函数以及小端大端(小尾大尾)模式
- Vim_vimdiff howto
- Hibernate_log4j
- 一句话引起的血案
- 独立开发者创业过程中会犯的14个错误
- Swift3.0 监听UITextView文字改变
- 关于不同的程序入口,main(), _tmain(),WinMain(),wmain()?