Setup Environment for Development Custom Tag : Introduction « JSTL « Java Tutorial

package taglib;

import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;


public class MyTag extends TagSupport 
    public int doStartTag() throws JspException 
        return EVAL_BODY_INCLUDE;
    public int doAfterBody() throws JspException 
            return SKIP_BODY;


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
        PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"


  A simple tag library 

  <!-- log tag -->
  Log a message.


<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  Example web application illustrating the use of tags in the
  "request" custom tag library, from the JAKARTA-TAGLIBS project.


JSTL code

<%@ taglib uri="" prefix="l"%>
        <TITLE>Creating a Simple Custom Tag</TITLE>

        <H1>Creating a Simple Custom Tag</H1>
            I'm sending some text to the server console!
  Download: 135 k)

24.1.1.Setup Environment for JSTL
24.1.2.Setup Environment for Development Custom Tag
24.1.3.JSTL JSP XML Format Page
24.1.4.JSTL in XML Format