Class 2 Intermediate Java 30-IT-397  

EndTable.class

package table;

// import the necessary libraries.
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.*;

/**
 * Simple custom JSP tag that ends a row and table.
 *
 * 12/18/2001 jonesbr@email.uc.edu
 **/

public class EndTable extends TagSupport {
 

    // method acts when the first tag is reached.
    public int doStartTag() {

        try {
            // Get an output stream for our tag's output.
            JspWriter out = pageContext.getOut();

            // Write the end table tags.
            out.print("</tr></table>");

            // In case we have an error...
        } catch (IOException e) {
            System.out.println("Error in BeginTable: " + e.getMessage());
        }

        // Tell it that we don't need to look at the contents between the tags.
        return(SKIP_BODY);

    // End the method.
    }

// End the class.
}
 

 Back

Created by:  Brandan Jones December 17, 2001