Class AuthCheckTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
jakarta.servlet.jsp.tagext.BodyTagSupport
com.randomnoun.common.webapp.taglib.AuthCheckTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.BodyTag,jakarta.servlet.jsp.tagext.IterationTag,jakarta.servlet.jsp.tagext.JspTag,jakarta.servlet.jsp.tagext.Tag,Serializable
Custom JSP tag which is used to ensure that the page was generated from within struts.
This is used to prevent users from typing in JSP URLs directly, bypassing
our security mechanisms.
- Author:
- knoxg
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport
bodyContentFields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface jakarta.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoEndTag()doEnd tag handler required to fulfill the Tag interface defined in the JSP specification.intdoStart tag handler required to fulfill the Tag interface defined in the JSP specification.Methods inherited from class jakarta.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContentMethods inherited from class jakarta.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Constructor Details
-
AuthCheckTag
public AuthCheckTag()
-
-
Method Details
-
doStartTag
doStart tag handler required to fulfill the Tag interface defined in the JSP specification.This method determines whether this request has come via the struts framework, by checking the value of the 'isStrutsRequest' request attribute. This is set on every request by the
class. This tag is always empty, and therefore must always return BodyTag.SKIP_BODYinvalid reference
com.randomnoun.common.webapp.struts.RequestProcessor- Specified by:
doStartTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjakarta.servlet.jsp.tagext.BodyTagSupport- Returns:
- BodyTag.SKIP_BODY
- Throws:
jakarta.servlet.jsp.JspException
-
doEndTag
doEnd tag handler required to fulfill the Tag interface defined in the JSP specification.This method enforces the presence of the 'isStrutsRequest' request attribute. If the attribute is present, then processing continues normally, otherwise an error message is given to the user, and the requested URL is sent to the logger of this class.
Note that the output of this tag is *not* internationalised.
- Specified by:
doEndTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjakarta.servlet.jsp.tagext.BodyTagSupport- Returns:
- BodyTag.SKIP_BODY or BodyTag.SKIP_PAGE
- Throws:
jakarta.servlet.jsp.JspException
-