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
bodyContent
Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, pageContext
Fields inherited from interface jakarta.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
Fields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
doEndTag()
doEnd tag handler required to fulfill the Tag interface defined in the JSP specification.int
doStart 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, setBodyContent
Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
invalid reference
com.randomnoun.common.webapp.struts.RequestProcessor
- Specified by:
doStartTag
in interfacejakarta.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in 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:
doEndTag
in interfacejakarta.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjakarta.servlet.jsp.tagext.BodyTagSupport
- Returns:
- BodyTag.SKIP_BODY or BodyTag.SKIP_PAGE
- Throws:
jakarta.servlet.jsp.JspException
-