|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ tag overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.RuntimeCollective.webapps.tag
Class CheckViewTag

java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
com.RuntimeCollective.webapps.tag.CheckViewTag
- All Implemented Interfaces:
- javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
- public final class CheckViewTag
- extends javax.servlet.jsp.tagext.TagSupport
Check if a user can view the named session-scoped bean. This bean must implement the PermissionBean interface. If they do not have permission to view this bean, control will be forwarded to a page that will display errors (defaults to /logon.jsp).
By default, the User on the session under RuntimeParameters.get("logonUserKey") will be used. A different User bean on the session can be used by specifying the "user" parameter.
This tag assumes the user is logged on; this tag should be used after checkLogon (unless "user" is specified).
Attributes:
- name - The name of the bean to check view permissions for
- user - [optional] The name of the user bean to check permissions with - defaults to RuntimeParameters.get("logonUserKey")
- page - the page to go to if the user is not logged in (defaults to /logon.jsp)
For example, inserting
<rs:checkView name="com.RuntimeCollective.school.bean.Course"/>
<%@ taglib uri="/WEB-INF/runtime-struts.tld" prefix="rs" %>
into a jsp page will check that the user in the session under RuntimeParameters.get("logonUserKey") can view the com.RuntimeCollective.school.bean.Course bean.
The following errors are returned
error.permission.viewDeniederror.permission.nullValueserror.db.connectionerror.permission.nullSession
- Version:
- $Id: CheckViewTag.java,v 1.5 2003/09/30 15:13:16 joe Exp $
| Field Summary | |
private java.lang.String |
name
The key of the session-scope bean we check permissions for. |
private java.lang.String |
page
The page to which we should forward for the user to log on. |
private java.lang.String |
user
The key of the user to check permissions for. |
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, pageContext |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Constructor Summary | |
CheckViewTag()
|
|
| Method Summary | |
int |
doEndTag()
Perform a permissions check by calling the specified bean's canView method, with the current user. |
int |
doStartTag()
Defer our checking until the end of this tag is encountered. |
java.lang.String |
getName()
Return the bean name. |
java.lang.String |
getPage()
Return the forward page. |
java.lang.String |
getUser()
Return the user. |
void |
release()
Release any acquired resources. |
void |
setName(java.lang.String name)
Set the bean name. |
void |
setPage(java.lang.String page)
Set the forward page. |
void |
setUser(java.lang.String user)
Set the user. |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, 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 |
| Field Detail |
name
private java.lang.String name
- The key of the session-scope bean we check permissions for.
page
private java.lang.String page
- The page to which we should forward for the user to log on. Defaults to "/logon.jsp".
user
private java.lang.String user
- The key of the user to check permissions for. Defaults to
RuntimeParameters.get("logonUserKey")
| Constructor Detail |
CheckViewTag
public CheckViewTag()
| Method Detail |
getName
public java.lang.String getName()
- Return the bean name.
setName
public void setName(java.lang.String name)
- Set the bean name.
getPage
public java.lang.String getPage()
- Return the forward page.
setPage
public void setPage(java.lang.String page)
- Set the forward page.
getUser
public java.lang.String getUser()
- Return the user.
setUser
public void setUser(java.lang.String user)
- Set the user.
doStartTag
public int doStartTag()
throws javax.servlet.jsp.JspException
- Defer our checking until the end of this tag is encountered.
doEndTag
public int doEndTag()
throws javax.servlet.jsp.JspException
- Perform a permissions check by calling the specified bean's
canViewmethod, with the current user. If either of these beans are blank, or there is no session, or the user does not have permissions to access that bean, control will be forwarded to the specified error page with an appropriate error message set.
release
public void release()
- Release any acquired resources.
|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ tag overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC