Class CodeTag

java.lang.Object
jakarta.servlet.jsp.tagext.SimpleTagSupport
net.thauvin.erik.httpstatus.taglibs.CodeTag
All Implemented Interfaces:
JspTag, SimpleTag

public class CodeTag extends SimpleTagSupport
Outputs the HTTP status code associated with the current error being processed by the JSP container. If no error information is available, the tag produces no output.

This tag is typically used on JSP error pages to display the numeric status code that triggered the error handling mechanism.

Since:
1.0
Author:
Erik C. Thauvin
  • Constructor Details

    • CodeTag

      public CodeTag()
  • Method Details

    • doTag

      public void doTag() throws IOException
      Writes the HTTP status code to the current output stream. If the page is not processing an error, no output is generated.
      Specified by:
      doTag in interface SimpleTag
      Overrides:
      doTag in class SimpleTagSupport
      Throws:
      IOException - If an error occurs while writing output