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

📄 sysfunction_005fselect_jsp.java

📁 一个简单的java web项目 基于servlet构建
💻 JAVA
字号:
package org.apache.jsp.pages.LeftMenu.system_005fmanage.function_005fmanage;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;

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

  private static java.util.List _jspx_dependants;

  public Object 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;
    PageContext _jspx_page_context = null;


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

      out.write('\r');
      out.write('\n');

	String cpath=request.getContextPath();

      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html style=\"width:100%\">\r\n");
      out.write("  <head>\r\n");
      out.write("    <title>系统功能权限分配</title>\r\n");
      out.write("  </head>\r\n");
      out.write("\t\t<link href=\"");
      out.print(cpath);
      out.write("/style/layout.css\" rel=\"stylesheet\"\r\n");
      out.write("\t\t\ttype=\"text/css\" />\r\n");
      out.write("\t\t<link href=\"");
      out.print(cpath);
      out.write("/style/mian.css\" rel=\"stylesheet\"\r\n");
      out.write("\t\t\ttype=\"text/css\" />\r\n");
      out.write("\t\t<link href=\"");
      out.print(cpath);
      out.write("/style/css_common1.css\" rel=\"stylesheet\"\r\n");
      out.write("\t\t\ttype=\"text/css\" />  \r\n");
      out.write("\t\t<script src=\"");
      out.print(cpath);
      out.write("/js/jquery126.js\"></script>\r\n");
      out.write("\t\t<script src=\"");
      out.print(cpath);
      out.write("/js/effect.js\"></script>\t\t\t\t\r\n");
      out.write("<script><!--\r\n");
      out.write("\t  $(function(){\r\n");
      out.write("\t  \taddInputEffect();  \t\r\n");
      out.write("\t  });\r\n");
      out.write("\tvar http_request=null;\r\n");
      out.write("\tfunction getHTTPRequest(){\r\n");
      out.write("\tif(window.ActiveXObject){\r\n");
      out.write("        http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n");
      out.write("     }\t\t\r\n");
      out.write("\t}\r\n");
      out.write("\tfunction getDest(){\r\n");
      out.write("\t try{\r\n");
      out.write("\t  document.destForm.dest.disabled=true;\r\n");
      out.write("\t  document.destForm.dest.length=1;\r\n");
      out.write("\t  document.destForm.dest.options[0]=new Option(\"请稍侯...\",\"请稍侯...\");\r\n");
      out.write("\r\n");
      out.write("      if(http_request==null){\r\n");
      out.write("      \tgetHTTPRequest();\r\n");
      out.write("      }\r\n");
      out.write("  \t  http_request.onreadystatechange=getResult;\r\n");
      out.write("  \t  var act=\"\";\r\n");
      out.write("  \t  if(document.destForm.destType.value==\"User\"){\r\n");
      out.write("  \t  \tact=\"");
      out.print(cpath);
      out.write("/sysuser/getAllUsers.action\";\r\n");
      out.write("  \t  }\r\n");
      out.write("  \t  else if(document.destForm.destType.value==\"Role\"){\r\n");
      out.write("  \t  \tact=\"");
      out.print(cpath);
      out.write("/sysrole/getAllRoles.action\";\r\n");
      out.write("  \t  }\r\n");
      out.write("  \t  http_request.open(\"GET\",act,true);\r\n");
      out.write("  \t  //http_request.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\t\r\n");
      out.write("  \t  //http_request.setRequestHeader(\"Content-Type\",\"text/html;charset=UTF-8\");\r\n");
      out.write("  \t  http_request.send(null);     \r\n");
      out.write("  \t }\r\n");
      out.write("  \t catch(ex){\r\n");
      out.write("  \t \talert(ex.name+\":\"+ex.message);\r\n");
      out.write("  \t }\r\n");
      out.write("\t}\r\n");
      out.write("\tfunction getResult(){\r\n");
      out.write("\t  if(http_request!=null){\r\n");
      out.write("\t    if(http_request.readystate==4){\r\n");
      out.write("\t      if(http_request.status==200){\r\n");
      out.write("\t        document.destForm.dest.disabled=false;\r\n");
      out.write("\t        fillList(http_request.responseText);\r\n");
      out.write("\t        goSelect();\r\n");
      out.write("\t        http_request=null;\r\n");
      out.write("\t      }\r\n");
      out.write("\t    }\r\n");
      out.write("\t  }\t\t\r\n");
      out.write("\t}\r\n");
      out.write("\tfunction fillList(txt){//填充列表值\r\n");
      out.write("\t\t//alert(txt);\r\n");
      out.write("\t\tvar destList=document.destForm.dest;\r\n");
      out.write("\t\tdestList.length=0;\r\n");
      out.write("\t\tvar destArray=new Array();\r\n");
      out.write("\t\tdestArray=txt.split(\",\");\r\n");
      out.write("\t\tfor(i=0;i<destArray.length;i++){\r\n");
      out.write("\t\t\tvar kv=new Array();\r\n");
      out.write("\t\t\tkv=destArray[i].split(\"=\");\r\n");
      out.write("\t\t\tif(kv[1]!=null||kv[1]!=\"\"){\r\n");
      out.write("\t\t\t\tdestList.options[destList.length]=new Option(kv[1],kv[0]);\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\tselSign=0;\t\t\t\r\n");
      out.write("\t}\r\n");
      out.write("\tvar selSign=0;\r\n");
      out.write("\tfunction goSelect(){//双击选择该用户\r\n");
      out.write("\t\tvar destList=document.destForm.dest;\r\n");
      out.write("\t\tif(destList.options[destList.selectedIndex].value!=null&&destList.options[destList.selectedIndex].value.replace(/(^\\s*)/g, \"\")!=\"\"){\r\n");
      out.write("\t\t\tif(selSign!=-1){\r\n");
      out.write("\t\t\t\tdestList.options[selSign].style.backgroundColor=\"\";\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t\tselSign=destList.selectedIndex;\r\n");
      out.write("\t\t\t//destList.options[selSign].style.backgroundColor=\"red\";\r\n");
      out.write("\t\t\tif(parent.frames[\"funcList\"].funcForm!=null){\r\n");
      out.write("\t\t\t\tparent.frames[\"funcList\"].funcForm.dest.value=destList.options[selSign].value;\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t\t//将功能列表中显示选中的项信息\r\n");
      out.write("\t\t\tif(parent.frames[\"funcList\"].document.getElementById(\"selTitle\")!=null){\r\n");
      out.write("\t\t\t\tparent.frames[\"funcList\"].document.getElementById(\"selTitle\").innerHTML=getCurrentDestTypeName()+\":\"+getCurrentDestName()+\"(\"+getCurrentDest()+\")\";\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t\t//刷新功能权限分配\r\n");
      out.write("\t\t\tparent.frames[\"funcList\"].location.href=\"");
      out.print(cpath);
      out.write("/function/getAllFuncs.action?destType=\"+getCurrentDestType()+\"&&dest=\"+getCurrentDest();\r\n");
      out.write("\t\t}\r\n");
      out.write("\t}\r\n");
      out.write("\tfunction getCurrentDest(){\r\n");
      out.write("\t\tif(selSign!=-1){\r\n");
      out.write("\t\t\treturn document.destForm.dest.options[selSign].value;\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\telse{\r\n");
      out.write("\t\t\treturn \"\";\r\n");
      out.write("\t\t}\r\n");
      out.write("\t}\r\n");
      out.write("\tfunction getCurrentDestName(){\r\n");
      out.write("\t\tif(selSign!=-1){\r\n");
      out.write("\t\t\treturn document.destForm.dest.options[selSign].innerHTML;\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\telse{\r\n");
      out.write("\t\t\treturn \"\";\r\n");
      out.write("\t\t}\t\r\n");
      out.write("\t}\r\n");
      out.write("\tfunction getCurrentDestType(){\r\n");
      out.write("\t\treturn document.destForm.destType.value;\r\n");
      out.write("\t}\r\n");
      out.write("\tfunction getCurrentDestTypeName(){\r\n");
      out.write("\t\treturn document.destForm.destType.options[document.destForm.destType.selectedIndex].innerHTML;\r\n");
      out.write("\t}\t\r\n");
      out.write("</script>\t\t\t\r\n");
      out.write("  <body style=\"width:100%\">\r\n");
      out.write("  \t<form name=\"destForm\">\r\n");
      out.write("    <table style=\"width:100%;\" cellpadding=\"0\" cellspacing=\"0\" class=\"bgOffice\">\r\n");
      out.write("    \t<tr>\r\n");
      out.write("\t\t\t\t\t<td height=\"25\" colspan=\"7\"\r\n");
      out.write("\t\t\t\t\t\tbackground=\"");
      out.print(cpath);
      out.write("/images/left_top_bg.jpg\"\r\n");
      out.write("\t\t\t\t\t\tclass=\"new_white_1\">\r\n");
      out.write("\t\t\t\t\t\t分配者\r\n");
      out.write("\t\t\t\t\t</td>    \t\r\n");
      out.write("    \t</tr>\r\n");
      out.write("\r\n");
      out.write("    <tr><td>\r\n");
      out.write("    <table style=\"width:100%;\" cellpadding=\"0\" cellspacing=\"0\" class=\"bgOffice table02\">\r\n");
      out.write("    \t<tr>\r\n");
      out.write("    \t\t<td align=\"right\">分配单位:\r\n");
      out.write("    \t\t</td>\r\n");
      out.write("    \t\t<td height=\"30\" class=\"bgInput\">\r\n");
      out.write("    \t\t\t<select name=\"destType\" onchange=\"getDest()\" style=\"width:150px\">\r\n");
      out.write("    \t\t\t\t<option value=\"User\">用户</option>\r\n");
      out.write("    \t\t\t\t<option value=\"Role\">角色</option>\r\n");
      out.write("    \t\t\t</select>\r\n");
      out.write("    \t\t</td>\r\n");
      out.write("    \t\t<td align=\"right\">分配目标:\r\n");
      out.write("    \t\t</td>    \t\t\r\n");
      out.write("    \t\t<td height=\"100%\" class=\"bgInput\">\r\n");
      out.write("    \t\t\t<select name=\"dest\" onchange=\"goSelect()\" style=\"width:150px\">\r\n");
      out.write("    \t\t\t\t<option value=\"\">--</option>\r\n");
      out.write("    \t\t\t</select>\r\n");
      out.write("    \t\t</td>    \t\t\r\n");
      out.write("    \t</tr>\r\n");
      out.write("    \r\n");
      out.write("    </table>\r\n");
      out.write("    </td></tr>\r\n");
      out.write("    <tr>\r\n");
      out.write("\t\t\t<td width=\"100%\" style=\"background-color:white\">\r\n");
      out.write("\t\t\t\t&nbsp;\r\n");
      out.write("\t\t\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t</table>\r\n");
      out.write("    </form>\r\n");
      out.write("  </body>\r\n");
      out.write("<script>\r\n");
      out.write("\tgetDest();\r\n");
      out.write("</script>\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 (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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