JSTL函数 定义
来源:互联网 发布:ubuntu usr在那里 编辑:程序博客网 时间:2024/05/17 05:59
1 普遍类
2 方法必须是static
3 如果用spring 的话该类的参数的 setxxx();方法需要非static 否则无法注入。
4在WEB-INF 下建立 如 my.tld 文件 在如standard.jar 找到 fn.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 i18n-capable formatting library</description>
<display-name>JSTL fmt</display-name>
<tlib-version>1.1</tlib-version>
<short-name>my</short-name>
<uri>http://www.bjxt.com/oa/functions</uri>
<function>
<description>
Tests if an input string contains the specified substring in a case insensitive way.
</description>
<name>containsIgnoreCase</name>
<function-class>org.apache.taglibs.standard.functions.Functions</function-class>
<function-signature>boolean containsIgnoreCase(java.lang.String, java.lang.String)</function-signature>
<example>
<c:if test="${fn:containsIgnoreCase(name, searchString)}">
</example>
</function>
</taglib>
5 还需要在web.xml 注册下
<jsp-config>
<taglib>
<taglib-uri>http://www.bjxt.com/functions</taglib-uri>
<taglib-location>/WEB-INF/my.tld</taglib-location>
</taglib>
</jsp-config>
注意 <taglib-uri>需要放在<taglib-location>前面
<name>containsIgnoreCase</name> 必须和 函数名相同
6 jsp 界面引用
<%@ taglib uri="http://www.bjxt.com/oa/functions" prefix="my"%>
7使用
<c:if test="${my:hasPermissionBySn(user.id,'user',2)}">
<a href="#"
onclick="openWin('user.action?method=updateInput&id=${person.user.id }','chgpsw',600,100);">修改帐号</a>
</c:if>
- JSTL函数 定义
- JSTL函数
- JSTL函数
- JSTL函数
- JSTL函数
- JSTL函数
- JSTL 函数
- jstl 函数
- jstl函数
- jstl函数
- jstl 函数
- jstl中定义String数组
- JSTL字符串处理函数
- JSTL中的 FN函数
- jstl 字符串处理函数
- jstl 的 functions函数
- jstl 函数标签库
- jstl函数标签用法
- 光脚丫学LINQ(005):数据表之间的联接查询
- 介绍GNU C和C99标准中的可变参数宏(variadic macros)
- 安装linux开发环境(vim + ctags + taglist + cscope + cppcomplete + global )
- Struts2 与 Spring 集成实例
- 网站管理
- JSTL函数 定义
- 光脚丫学LINQ(006):投影
- linux下问题汇总
- asp.net中使用urlrewrite的方法
- 如何使我开发的程序的图标不使用系统的玻璃效果
- [转贴] 网管实战:Linux服务器静态路由配置
- Crossed ladders
- lucene
- android线程间通信