更新時(shí)間:2017-04-16 來(lái)源:黑馬程序員Java培訓(xùn)學(xué)院 瀏覽量:
package cn.itcast.fn; public class MyFunction { public static String print(){ return "創(chuàng)智播客之EL函數(shù)庫(kù)"; } } |
<?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>itcast</description> <display-name>itcast-function</display-name> <tlib-version>1.0</tlib-version> <short-name>it</short-name> <uri>http://www.itcast.cn/el/functions</uri> <function> <name>print</name> <function-class>cn.itcast.fn.MyFunction</function-class> <function-signature>java.lang.String print()</function-signature> </function> </taglib> |
<function> <description> Tests if an input string contains the specified substring. </description> <name>contains</name> <function-class>org.apache.taglibs.standard.functions.Functions</function-class> <function-signature>boolean contains(java.lang.String, java.lang.String)</function-signature> <example> <c:if test="${fn:contains(name, searchString)}"> </example> </function> |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="it" uri="/WEB-INF/tlds/itcast.tld" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <h1>${it:print() }</h1> </body> </html> |
本文版權(quán)歸黑馬程序員Java培訓(xùn)學(xué)院所有,歡迎轉(zhuǎn)載,轉(zhuǎn)載請(qǐng)注明作者出處。謝謝!
作者:黑馬程序員Java培訓(xùn)學(xué)院
首發(fā):http://409rqu1.cn/special/hmjavaeezly/