Class ReasonTag
java.lang.Object
jakarta.servlet.jsp.tagext.SimpleTagSupport
net.thauvin.erik.httpstatus.taglibs.XmlSupport
net.thauvin.erik.httpstatus.taglibs.ReasonTag
Outputs the HTTP status Reason Phrase for either the explicitly supplied
status code or, when none is provided, the status code associated with the
current error being processed by the JSP container.
If no reason phrase is available, the tag prints the configured default value. XML escaping is applied when enabled.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Field Summary
Fields inherited from class net.thauvin.erik.httpstatus.taglibs.XmlSupport
defaultValue, escapeXml -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class net.thauvin.erik.httpstatus.taglibs.XmlSupport
setDefault, setEscapeXmlMethods inherited from class jakarta.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
-
Constructor Details
-
ReasonTag
public ReasonTag()
-
-
Method Details
-
doTag
Writes the Reason Phrase for the current or specified HTTP status code. If the page is not processing an error and no explicit code is set, the default value is used instead.- Specified by:
doTagin interfaceSimpleTag- Overrides:
doTagin classSimpleTagSupport- Throws:
IOException- If an error occurs while writing output
-
setCode
public void setCode(int statusCode) Sets the HTTP status code to be used when resolving the Reason Phrase.
-