<?xml version="1.0" encoding="UTF-8" ?>
version="2.0">
<!-- 整个标签的名字 -->
<display-name>myTag</display-name>
<tlib-version>1.0</tlib-version>
<short-name>myTag</short-name>
<!-- 导入标签时的uri -->
<function>
<!-- 函数名 -->
<name>add</name>
<!-- 自定义的函数的全类名 -->
<function-class>com.mdd.tag.JiSuan</function-class>
<!-- 描述方法,主要通过返回参数类型,方法签名,和方法名;注意,String类型及引用型变量要写全类型 基本数据类型则不需要 -->
<function-signature>double add(double,double)</function-signature>
<example>
Product name: ${mdd.add(a,b)}
</example>
</function>
</taglib>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP ‘index.jsp‘ starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
${myTag:add(1,2)}
</body>
</html>