下面是项目结构图:
下面是代码清单:
这是firstTag.tag文件
<%@ tag import="java.util.Date" import="java.text.DateFormat" %> <% DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL) ; Date now = new Date(System.currentTimeMillis()) ; out.println(dateFormat.format(now)) ; %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ taglib prefix="easy" tagdir="/WEB-INF/tags" %> <html> <head> <title>My JSP 'firstTagTest.jsp' starting page</title> </head> <body> Today is <easy:firstTag></easy:firstTag> </body> </html>
原文:http://blog.csdn.net/benjamin_whx/article/details/38682963