分类：电脑/网络-互联网
问题：J2EE权限设置问题(jsp+servlet+javabean) 
回答：import  .Exception;import  rvlet.Filter;import  rvlet.FilterChain;import  rvlet.FilterConfig;import  rvlet.ServletException;import  rvlet.ServletRequest;import  rvlet.ServletResponse;import  tp.HttpServletRequest;import  tp.HttpServletResponse;/** *  * @author  *  */public class PrivilegeFilter implements Filter { /**  * 权限过滤器  */ private HttpServletRequest request; private HttpServletResponse response; public void destroy() {  // TODO Auto-generated method stub } public void doFilter(ServletRequest arg0, ServletResponse arg1,   FilterChain arg2) throws IOException, ServletException {  // TODO Auto-generated method stub  request = (HttpServletRequest) arg0;  response = (HttpServletResponse) arg1;  // 获取session中的管理员或用户标识  String notify =  tSession(true).getAttribute("你设置的属性");             //权限符合，自己写  if (){   //               }                else if(){              //                        }  else { //没有权限   Logger.log("请求被拦截,你没有相关权限！");    ndRedirect("指定的页面");  } } public void init(FilterConfig arg0) throws ServletException {  // TODO Auto-generated method stub }}在web.xml中配置：<filter>  <filter-name>privilegeFilter</filter-name>  <filter-class>PrivilegeFilter</filter-class> </filter> <filter-mapping>  <filter-name>privilegeFilter</filter-name>  <url-pattern>/*</url-pattern> </filter-mapping>  <url-pattern>可以配置自己需要的路径