当前位置: 首页>>代码示例>>Java>>正文


Java SecurityUtil.isPackageProtectionEnabled方法代码示例

本文整理汇总了Java中org.apache.jasper.security.SecurityUtil.isPackageProtectionEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java SecurityUtil.isPackageProtectionEnabled方法的具体用法?Java SecurityUtil.isPackageProtectionEnabled怎么用?Java SecurityUtil.isPackageProtectionEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jasper.security.SecurityUtil的用法示例。


在下文中一共展示了SecurityUtil.isPackageProtectionEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: forward

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public void forward(final String relativeUrlPath) throws ServletException, IOException {
	if (SecurityUtil.isPackageProtectionEnabled()) {
		try {
			AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
				@Override
				public Void run() throws Exception {
					doForward(relativeUrlPath);
					return null;
				}
			});
		} catch (PrivilegedActionException e) {
			Exception ex = e.getException();
			if (ex instanceof IOException) {
				throw (IOException) ex;
			} else {
				throw (ServletException) ex;
			}
		}
	} else {
		doForward(relativeUrlPath);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:24,代码来源:PageContextImpl.java

示例2: setAttribute

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
public void setAttribute(final String name, final Object o, final int scope) {

		if (name == null) {
			throw new NullPointerException(Localizer
					.getMessage("jsp.error.attribute.null_name"));
		}

		if (SecurityUtil.isPackageProtectionEnabled()) {
			AccessController.doPrivileged(new PrivilegedAction() {
				public Object run() {
					doSetAttribute(name, o, scope);
					return null;
				}
			});
		} else {
			doSetAttribute(name, o, scope);
		}

	}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:PageContextImpl.java

示例3: getAttributesScope

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public int getAttributesScope(final String name) {

    if (name == null) {
        throw new NullPointerException(Localizer
                .getMessage("jsp.error.attribute.null_name"));
    }

    if (SecurityUtil.isPackageProtectionEnabled()) {
        return (AccessController
                .doPrivileged(new PrivilegedAction<Integer>() {
                    @Override
                    public Integer run() {
                        return Integer.valueOf(doGetAttributeScope(name));
                    }
                })).intValue();
    } else {
        return doGetAttributeScope(name);
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:21,代码来源:PageContextImpl.java

示例4: removeAttribute

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public void removeAttribute(final String name) {

    if (name == null) {
        throw new NullPointerException(Localizer
                .getMessage("jsp.error.attribute.null_name"));
    }

    if (SecurityUtil.isPackageProtectionEnabled()) {
        AccessController.doPrivileged(new PrivilegedAction<Void>() {
            @Override
            public Void run() {
                doRemoveAttribute(name);
                return null;
            }
        });
    } else {
        doRemoveAttribute(name);
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:21,代码来源:PageContextImpl.java

示例5: removeAttribute

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public void removeAttribute(final String name, final int scope) {

    if (name == null) {
        throw new NullPointerException(Localizer
                .getMessage("jsp.error.attribute.null_name"));
    }
    if (SecurityUtil.isPackageProtectionEnabled()) {
        AccessController.doPrivileged(new PrivilegedAction<Void>() {
            @Override
            public Void run() {
                doRemoveAttribute(name, scope);
                return null;
            }
        });
    } else {
        doRemoveAttribute(name, scope);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:20,代码来源:PageContextImpl.java

示例6: removeAttribute

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
public void removeAttribute(final String name, final int scope) {

		if (name == null) {
			throw new NullPointerException(Localizer
					.getMessage("jsp.error.attribute.null_name"));
		}
		if (SecurityUtil.isPackageProtectionEnabled()) {
			AccessController.doPrivileged(new PrivilegedAction() {
				public Object run() {
					doRemoveAttribute(name, scope);
					return null;
				}
			});
		} else {
			doRemoveAttribute(name, scope);
		}
	}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:PageContextImpl.java

示例7: setAttribute

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public void setAttribute(final String name, final Object o, final int scope) {

    if (name == null) {
        throw new NullPointerException(Localizer
                .getMessage("jsp.error.attribute.null_name"));
    }

    if (SecurityUtil.isPackageProtectionEnabled()) {
        AccessController.doPrivileged(new PrivilegedAction<Void>() {
            @Override
            public Void run() {
                doSetAttribute(name, o, scope);
                return null;
            }
        });
    } else {
        doSetAttribute(name, o, scope);
    }

}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:22,代码来源:PageContextImpl.java

示例8: findAttribute

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
public Object findAttribute(final String name) {
	if (SecurityUtil.isPackageProtectionEnabled()) {
		return AccessController.doPrivileged(new PrivilegedAction() {
			public Object run() {
				if (name == null) {
					throw new NullPointerException(Localizer
							.getMessage("jsp.error.attribute.null_name"));
				}

				return doFindAttribute(name);
			}
		});
	} else {
		if (name == null) {
			throw new NullPointerException(Localizer
					.getMessage("jsp.error.attribute.null_name"));
		}

		return doFindAttribute(name);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:PageContextImpl.java

示例9: include

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public void include(final String relativeUrlPath, final boolean flush)
        throws ServletException, IOException {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        try {
            AccessController.doPrivileged(
                    new PrivilegedExceptionAction<Void>() {
                @Override
                public Void run() throws Exception {
                    doInclude(relativeUrlPath, flush);
                    return null;
                }
            });
        } catch (PrivilegedActionException e) {
            Exception ex = e.getException();
            if (ex instanceof IOException) {
                throw (IOException) ex;
            } else {
                throw (ServletException) ex;
            }
        }
    } else {
        doInclude(relativeUrlPath, flush);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:26,代码来源:PageContextImpl.java

示例10: forward

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public void forward(final String relativeUrlPath) throws ServletException,
        IOException {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        try {
            AccessController.doPrivileged(
                    new PrivilegedExceptionAction<Void>() {
                @Override
                public Void run() throws Exception {
                    doForward(relativeUrlPath);
                    return null;
                }
            });
        } catch (PrivilegedActionException e) {
            Exception ex = e.getException();
            if (ex instanceof IOException) {
                throw (IOException) ex;
            } else {
                throw (ServletException) ex;
            }
        }
    } else {
        doForward(relativeUrlPath);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:26,代码来源:PageContextImpl.java

示例11: getInstance

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
/**
 * Generated Servlet and Tag Handler implementations call this method to
 * retrieve an instance of the ProtectedFunctionMapper. This is necessary
 * since generated code does not have access to create instances of classes
 * in this package.
 * 
 * @return A new protected function mapper.
 */
public static ProtectedFunctionMapper getInstance() {
    ProtectedFunctionMapper funcMapper;
    if (SecurityUtil.isPackageProtectionEnabled()) {
        funcMapper = (ProtectedFunctionMapper) AccessController
                .doPrivileged(new PrivilegedAction() {
                    public Object run() {
                        return new ProtectedFunctionMapper();
                    }
                });
    } else {
        funcMapper = new ProtectedFunctionMapper();
    }
    funcMapper.fnmap = new java.util.HashMap();
    return funcMapper;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:ProtectedFunctionMapper.java

示例12: findAttribute

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public Object findAttribute(final String name) {
	if (SecurityUtil.isPackageProtectionEnabled()) {
		return AccessController.doPrivileged(new PrivilegedAction<Object>() {
			@Override
			public Object run() {
				if (name == null) {
					throw new NullPointerException(Localizer.getMessage("jsp.error.attribute.null_name"));
				}

				return doFindAttribute(name);
			}
		});
	} else {
		if (name == null) {
			throw new NullPointerException(Localizer.getMessage("jsp.error.attribute.null_name"));
		}

		return doFindAttribute(name);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:22,代码来源:PageContextImpl.java

示例13: include

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
public void include(final String relativeUrlPath, final boolean flush)
		throws ServletException, IOException {
	if (SecurityUtil.isPackageProtectionEnabled()) {
		try {
			AccessController.doPrivileged(new PrivilegedExceptionAction() {
				public Object run() throws Exception {
					doInclude(relativeUrlPath, flush);
					return null;
				}
			});
		} catch (PrivilegedActionException e) {
			Exception ex = e.getException();
			if (ex instanceof IOException) {
				throw (IOException) ex;
			} else {
				throw (ServletException) ex;
			}
		}
	} else {
		doInclude(relativeUrlPath, flush);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:PageContextImpl.java

示例14: getAttribute

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
public Object getAttribute(final String name) {

		if (name == null) {
			throw new NullPointerException(Localizer
					.getMessage("jsp.error.attribute.null_name"));
		}

		if (SecurityUtil.isPackageProtectionEnabled()) {
			return AccessController.doPrivileged(new PrivilegedAction() {
				public Object run() {
					return doGetAttribute(name);
				}
			});
		} else {
			return doGetAttribute(name);
		}

	}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:PageContextImpl.java

示例15: forward

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
public void forward(final String relativeUrlPath) throws ServletException,
		IOException {
	if (SecurityUtil.isPackageProtectionEnabled()) {
		try {
			AccessController.doPrivileged(new PrivilegedExceptionAction() {
				public Object run() throws Exception {
					doForward(relativeUrlPath);
					return null;
				}
			});
		} catch (PrivilegedActionException e) {
			Exception ex = e.getException();
			if (ex instanceof IOException) {
				throw (IOException) ex;
			} else {
				throw (ServletException) ex;
			}
		}
	} else {
		doForward(relativeUrlPath);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:PageContextImpl.java


注:本文中的org.apache.jasper.security.SecurityUtil.isPackageProtectionEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。