⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 purviewlist_jsp.java

📁 JSP移动商品管理平台源代码.........
💻 JAVA
字号:
package org.apache.jsp.imis_005fmanager;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.Hashtable;
import java.util.ArrayList;
import java.util.Iterator;
import java.net.*;

public final class PurviewList_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=gb2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"../error/error.jsp", true, 8192, true);
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      bean.TreeCom.TreeBean MenuTree = null;
      synchronized (pageContext) {
        MenuTree = (bean.TreeCom.TreeBean) pageContext.getAttribute("MenuTree", PageContext.PAGE_SCOPE);
        if (MenuTree == null){
          try {
            MenuTree = (bean.TreeCom.TreeBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "bean.TreeCom.TreeBean");
          } catch (ClassNotFoundException exc) {
            throw new InstantiationException(exc.getMessage());
          } catch (Exception exc) {
            throw new ServletException("Cannot create bean of class " + "bean.TreeCom.TreeBean", exc);
          }
          pageContext.setAttribute("MenuTree", MenuTree, PageContext.PAGE_SCOPE);
        }
      }
      out.write("\r\n");
      bean.roles.RolesBean Roles = null;
      synchronized (pageContext) {
        Roles = (bean.roles.RolesBean) pageContext.getAttribute("Roles", PageContext.PAGE_SCOPE);
        if (Roles == null){
          try {
            Roles = (bean.roles.RolesBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "bean.roles.RolesBean");
          } catch (ClassNotFoundException exc) {
            throw new InstantiationException(exc.getMessage());
          } catch (Exception exc) {
            throw new ServletException("Cannot create bean of class " + "bean.roles.RolesBean", exc);
          }
          pageContext.setAttribute("Roles", Roles, PageContext.PAGE_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n  ");
      out.write("<title>权限列表");
      out.write("</title> \r\n  ");
      out.write("<link href=\"css/TreeCom.css\" rel=\"stylesheet\" type=\"text/css\">  \r\n  ");
      out.write("<script src=\"js/CheckTreeCom.js\" type=\"text/javascript\">");
      out.write("</script> \r\n");
      out.write("</head>\r\n");
      out.write("<script language=\"javascript\">\r\nfunction OpenRoleDlg(s1,s2,s3,s4,s5,s6){\r\n       \task=confirm(\"你确定将修改该记录权限吗?\\n\\n点“确定”继续,点“取消”返回\"); \r\n  \tif (ask){\r\n\t\t\tsPurview \t= \ts3;\r\n\t\t\ttemp  \t\t= \t\"a\"+s5+\"a\";\r\n\t\t\tsPurview\t=\tsPurview.replace(temp,\"a\");\r\n        \t\tif (s2 == \"0\"){\r\n        \t\t\t\r\n        \t\t\tif(sPurview.substr(sPurview.length-1,1)=='a')sPurview = sPurview.substr(0,sPurview.length-1);\r\n        \t\t\tsPurview = sPurview + temp;\r\n        \t\t}\r\n        \t\telse{\r\n        \t\t    //sPurview=sPurview.substr(0,sPurview.indexOf(temp)-1)+\"a\"+sPurview.substr(sPurview.indexOf(temp)+temp.length,sPurview.length-(sPurview.indexOf(temp)+temp.length)+1);\r\n        \t\t    //sPurview\t=\tsPurview.replace(temp,\"a\");\r\n        \t\t    if (sPurview.length == 1) sPurview = \"\";\r\n        \t\t}\r\n        \t\tsHref=\"Role_Operate1.jsp?TRoleID=\"+s1\r\n        \t\t\t     +\"&TRoleName=\"+s6\r\n        \t\t     \t     +\"&TPurview=\"+sPurview\r\n        \t\t     \t     +\"&TRemark=-1\"\r\n        \t\t     \t     +\"&TAction=\"+s4;       \r\n      \t\t\twindow.open(sHref,\"_blank\",\"left=0,top=0,width=2, height=2, status=no, menubar=no, location=no, resizable=no, alwaysRaised=yes, z-look=yes, depended=yes\");      \t\t\t\r\n");
      out.write("      \t}\r\n}\r\nfunction submitRole(){\r\n       \task=confirm(\"你确定将修改该记录权限吗?\\n\\n点“确定”继续,点“取消”返回\"); \r\n  \tif (ask){\r\n        \tsHref\t=\t\"Role_Operate1.jsp?TRoleID=\"+document.all(\"TRoleID\").value\r\n         \t\t\t+\"&TRoleName=\"+document.all(\"TRoleName\").value\r\n        \t\t\t+\"&TPurview=\"+document.all(\"TPurview\").value\r\n        \t\t\t+\"&TRemark=\"+document.all(\"TRemark\").value\r\n        \t\t\t+\"&TAction=\"+document.all(\"TAction\").value;       \r\n      \t\twindow.open(sHref,\"_blank\",\"left=0,top=0,width=2, height=2, status=no, menubar=no, location=no, resizable=no, alwaysRaised=yes, z-look=yes, depended=yes\");\r\n      \t}\r\n}\t\r\nfunction ChangePurview(MenuID,CheckBoxName){\r\n\tsPurview \t= \tdocument.all(\"TPurview\").value;\r\n\ttemp  \t\t= \t\"a\"+MenuID+\"a\";\r\n\tsPurview\t=\tsPurview.replace(temp,\"a\");\r\n        if ( (document.all(CheckBoxName)) && (document.all(CheckBoxName).checked) ){\r\n        \t\t\t\r\n        \tif(sPurview.substr(sPurview.length-1,1)=='a')\tsPurview = sPurview.substr(0,sPurview.length-1);\r\n        \tsPurview = sPurview + temp;\r\n        }\r\n        else{\r\n");
      out.write("        \tif (sPurview.length == 1) sPurview = \"\";\r\n        }\r\n\tdocument.all(\"TPurview\").value  =  sPurview;\t\r\n}\r\n");
      out.write("</script>\r\n");
      out.write("<body topmargin=\"0\" leftmargin=\"0\" scrolling=\"auto\" background=\"images/bg_main.png\"> \r\n");
      out.write("<form name=\"FormPurview\" action=\"Role_Operate1.jsp\" >\r\n");
 

    
   byte temp [];
   String sRoleID   =   request.getParameter("TRoleID");
   temp=sRoleID.getBytes("iso-8859-1");   
   sRoleID=new String(temp);   
   
   String sRoleName =   ""; 
   String sPurview  =   ""; 
   String sAction   =   request.getParameter("TAction");
   temp=sRoleID.getBytes("iso-8859-1");   
   sRoleID=new String(temp);  

   if (sRoleID.equals("无")){
   	sRoleID = "";
   }
   else{
   	int    RoleID    =     Integer.parseInt(sRoleID);
   	ArrayList Rolelist = Roles.getRoles(RoleID);
   	Iterator Roleitr   = Rolelist.iterator();
   	if (Roleitr.hasNext()) {
			Hashtable Roleht = (Hashtable) Roleitr.next();   
   	
  			sRoleName    =  Roleht.get("RoleName").toString();
   	         	sPurview     =  Roleht.get("Purview").toString();
   	}   
   }
   int i=0;
   String sValue=null;
   String menu_id=null;
   String sup_menu_id=null;
   String menu_name=null;
   String menu_herf=null;
   String open_ico	=	null;
   String close_ico	=	null;    
   ArrayList list = MenuTree.getMenuTree();
   Iterator itr = list.iterator();
   while (itr.hasNext()) {
		Hashtable ht = (Hashtable) itr.next();   
  
            	menu_id      =  ht.get("menu_id").toString();
            	sup_menu_id  =  ht.get("sup_menu_id").toString(); 
            	menu_name    =  ht.get("menu_name").toString();
            	menu_herf    =  ht.get("menu_herf").toString();
            	open_ico     =  ht.get("open_ico").toString();
            	close_ico    =  ht.get("close_ico").toString();             	
            	
		sValue=menu_id+"|"+sup_menu_id+"|"+menu_name+"|"+menu_herf+"|"+close_ico+"|"+open_ico; 

      out.write("\r\n       \t\t");
      out.write("<input type=\"hidden\" name=\"");
      out.print(i);
      out.write("\"  value=");
      out.print(sValue);
      out.write(">               \r\n");

		i=i+1;
	}

      out.write("\r\n\t\t");
      out.write("<input type=\"hidden\" name=\"ilength\"  value=");
      out.print( i );
      out.write("> \r\n\t\t");
      out.write("<input type=\"hidden\" name=\"TRoleID\"  value=");
      out.print( sRoleID );
      out.write(">\t\r\n\t\t");
      out.write("<input type=\"hidden\" name=\"TRoleName\"  value=");
      out.print( sRoleName );
      out.write(">\r\n\t\t");
      out.write("<input type=\"hidden\" name=\"TPurview\"  value=");
      out.print( sPurview );
      out.write(">\r\n\t\t");
      out.write("<input type=\"hidden\" name=\"TRemark\"  value=\"\">\t\t\t\t\r\n\t\t");
      out.write("<input type=\"hidden\" name=\"TAction\"  value=");
      out.print( sAction );
      out.write("> \r\n");
      out.write("</form>\r\n");
      out.write("<table align=\"center\" background=\"images/bg_main2.png\"  width=\"760\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"20\">\r\n   ");
      out.write("<tr>\r\n  \t  ");
      out.write("<td align=\"left\" height=\"20\" style=\"font-family: Arial; style; font-size: 12px; color: #000000; letter-spacing:0px\"> \t  \r\n  \t  \t角色&nbsp;&nbsp;");
      out.write("<font color=\"blue\">");
      out.print(sRoleName);
      out.write("</font>&nbsp;&nbsp;权限信息&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n  \t  \t");
      out.write("<a href=\"javascript:submitRole();\">");
      out.write("<font color=\"blue\">[提交]");
      out.write("</font>");
      out.write("</a>&nbsp;&nbsp;");
      out.write("<a href=\"javascript:window.close();\">");
      out.write("<font color=\"blue\">[关闭]");
      out.write("</font>");
      out.write("</a>\r\n  \t  ");
      out.write("</td>\r\n   ");
      out.write("</tr>\r\n");
      out.write("</table>\t\t\t\t\t\t\r\n");
      out.write("<table width=\"760\" id=control border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"navbar\" align=\"center\" onLoad=\"initialize();\">\r\n");
      out.write("<div align=\"justify\">\r\n\t");
      out.write("<table border=0 class=\"navbar\"  align=\"left\">\r\n  \t\t");
      out.write("<tr>\r\n    \t\t\t");
      out.write("<td align=\"left\" valign=\"top\" width=\"50%\" rowspan=\"8\">\r\n    \t\t\t");
      out.write("<script language=\"javascript\">\r\n    \t\t\t\tobjTree\t= new treemenu(\"\",\"菜单列表\",\"images/close.gif\");\r\n\t    \t\t\tiNum=document.FormPurview.ilength.value;\r\n\t\t\t\tfor (pos=0;pos");
      out.write("<iNum;pos++){\r\n\t\t\t\t\tsName=pos.toString();\t\t\t\r\n\t\t\t\t        sValue=document.all(sName).value;\r\n\t\t\t\t\tSplitValue=sValue.split(\"|\");\t\r\n\t\t\t\t\tsRoleID=document.all(\"TRoleID\").value;\r\n\t\t\t\t\tsRoleName=document.all(\"TRoleName\").value;\r\n\t\t\t\t\tsPurview=document.all(\"TPurview\").value;\r\n\t\t\t\t\tsAction=document.all(\"TAction\").value;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttemp=\"a\"+SplitValue[0]+\"a\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (sPurview.indexOf(temp) == -1){\r\n\t\t\t\t\t\t//sAct=\"javascript:OpenRoleDlg('\"+sRoleID+\"','0','\"+sPurview+\"','\"+sAction+\"','\"+SplitValue[0]+\"','\"+sRoleName+\"')\";\t\r\n\t\t\t\t\t\tsAct=\"javascript:ChangePurview('\"+SplitValue[0]+\"','ck\"+SplitValue[0]+\"')\";\r\n\t\t\t\t\t     \t\t//      0 id          1 父id        2  名称          3 关闭图标   4 打开图标    5 地址  6 指向窗口 7 状态 8 动作\t\t\t\t\t\t\r\n\t\t\t\t\t\tadd_item(SplitValue[0],SplitValue[1],SplitValue[2],SplitValue[4],SplitValue[5], \"\", \"\", \"0\", sAct);\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t//sAct=\"javascript:OpenRoleDlg('\"+sRoleID+\"','1','\"+sPurview+\"','\"+sAction+\"','\"+SplitValue[0]+\"','\"+sRoleName+\"')\";\t\r\n\t\t\t\t\t\tsAct=\"javascript:ChangePurview('\"+SplitValue[0]+\"','ck\"+SplitValue[0]+\"')\";\r\n");
      out.write("\t\t\t\t\t     \t\t//      0 id          1 父id        2  名称          3 关闭图标   4 打开图标    5 地址  6 指向窗口 7 状态 8 动作\t\t\t\t\t\t\r\n\t\t\t\t\t\tadd_item(SplitValue[0],SplitValue[1],SplitValue[2],SplitValue[4],SplitValue[5], \"\", \"\", \"1\", sAct);\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsName=null;\r\n\t\t\t\t}\r\n\t\t\t\tdocument.write(menu(0));\r\n\t\t\t");
      out.write("</script>\r\n    \t\t\t");
      out.write("</td>\r\n  \t\t");
      out.write("</tr>\r\n\t");
      out.write("</table>\r\n");
      out.write("</div>\r\n");
      out.write("</table>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (pageContext != null) pageContext.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -