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

📄 usermanager_jsp.java

📁 这是基于jsp的任务管理系统
💻 JAVA
字号:
package org.apache.jsp.systemadmin;

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

public final class userManager_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=GB18030");
      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\n");
      out.write("\r\n");
      out.write("\r\n");

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html>\r\n");
      out.write("  <head>\r\n");
      out.write("    <base href=\"");
      out.print(basePath);
      out.write("\">    \r\n");
      out.write("    <style type=\"text/css\">\r\n");
      out.write("\t<!--\r\n");
      out.write("\t.STYLE1 {\r\n");
      out.write("\tcolor: #FFFFFF;\r\n");
      out.write("\tfont-weight: bold;\r\n");
      out.write("\ttext-align:center;\r\n");
      out.write("\tbackground-color:#0033FF;\r\n");
      out.write("\t}\r\n");
      out.write("\t-->\r\n");
      out.write("\t</style>\r\n");
      out.write("  </head>\r\n");
      out.write("  <body>\r\n");
      out.write("  <div align=left><a href=\"systemadmin/adduser.jsp\">添加用户</a></div>\r\n");
      out.write("   <table width=\"100%\" height=\"149\" border=\"1\" align=\"center\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"10%\" height=\"33\" bgcolor=\"#0033FF\" class=\"STYLE1\">序号</td>\r\n");
      out.write("    <td width=\"20%\" class=\"STYLE1\">用户名</td>\r\n");
      out.write("    <td width=\"20%\" class=\"STYLE1\">用户角色</td>\r\n");
      out.write("    <td width=\"20%\" class=\"STYLE1\">用户权限</td>\r\n");
      out.write("    <td width=\"30%\" class=\"STYLE1\">管理操作</td>\r\n");
      out.write("  </tr>\r\n");

DBConnection conn=new DBConnection();
ResultSet rs=conn.executeQuery("select user_id,user_name,user_charpter,user_power from user");

String str=(String)request.getParameter("Page");
if(str==null){
	str="0";
}
int pagesize=10;
rs.last();
int RecordCount=rs.getRow(); 
int maxPage=0;
maxPage=(RecordCount%pagesize==0)?(RecordCount/pagesize):(RecordCount/pagesize+1);

int Page=Integer.parseInt(str);
if(Page<1){
	Page=1;
}else{
	if(((Page-1)*pagesize+1)>RecordCount){
		Page=maxPage;
	}
}
rs.absolute((Page-1)*pagesize+1);
for(int i=1;i<=pagesize;i++){
	  int user_id=rs.getInt("user_id");
	  String user_name=rs.getString("user_name");
	  String user_charpter=rs.getString("user_charpter");
	  String user_power=rs.getString("user_power");	  

      out.write(" \r\n");
      out.write("  <tr>\r\n");
      out.write("  \r\n");
      out.write("    <td height=\"34\">");
      out.print(user_id);
      out.write("</td>\r\n");
      out.write("    <td>");
      out.print(user_name);
      out.write("</td>  \r\n");
      out.write("    <td>\r\n");
      out.write("   \r\n");
      out.write("\t");

	if(user_charpter.equals("1")){out.println("总经理");}
	if(user_charpter.equals("2")){out.println("部门经理");}
	if(user_charpter.equals("3")){out.println("普通员工");}
	//out.println(user_charpter);
    
      out.write("\t\r\n");
      out.write("\t</td>\r\n");
      out.write("    <td>\r\n");
      out.write("   \r\n");
      out.write("   ");

  // out.println(user_power);
   if(user_power==null){out.println("没有分配权限");}
   else if(user_power.equals("1")){out.println("系统管理员");}
   else if(user_power.equals("2")){out.println("设备管理员");}
   else if(user_power.equals("3")){out.println("普通员工");}
   else{out.println("");}
	//switch(Integer.parseInt(user_power)){ 	
//	case 1:out.println("系统管理员");break;
//	case 2:out.println("设备管理员");break;	
//	case 3:out.println("普通员工");break;} 
      out.write("     \r\n");
      out.write("    </td>\r\n");
      out.write("    \r\n");
      out.write("    \r\n");
      out.write("    <td align=\"center\"> \r\n");
      out.write("    <a href=\"UserController?action=edit&id=");
      out.print(user_id );
      out.write("\">修改</a> | \r\n");
      out.write("    <a href=\"UserController?action=del&id=");
      out.print(user_id );
      out.write("\">删除</a></td>\r\n");
      out.write("  </tr>\r\n");
      out.write(" ");
 

//}
	try{
	if(!rs.next()){break;}
		}catch(Exception e){}
}

      out.write("\r\n");
      out.write(" \r\n");
      out.write("\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td height=\"35\" colspan=\"5\">\r\n");
      out.write("当前页数:[");
      out.print(Page);
      out.write('/');
      out.print(maxPage);
      out.write("]&nbsp;\r\n");
      out.write("\t");
if(Page>1){
      out.write("\r\n");
      out.write("\t<a href=\"UserController?action=findAll&Page=1\">第一页</a> \r\n");
      out.write("\t<a href=\"UserController?action=findAll&Page=");
      out.print(Page-1);
      out.write("\">上一页</a>\r\n");
      out.write("\t");

	}
	if(Page<maxPage){
	
      out.write("\r\n");
      out.write("\t <a href=\"UserController?action=findAll&Page=");
      out.print(Page+1);
      out.write("\">下一页</a> \r\n");
      out.write("\t<a href=\"UserController?action=findAll&Page=");
      out.print(maxPage);
      out.write("\">最后一页&nbsp;</a>\r\n");
      out.write("\t");
}
	
      out.write("\t \t\t\r\n");
      out.write("   \t\t\r\n");
      out.write("  </td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("\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 (_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 + -