• 大小:
    文件类型: .rar
    金币: 2
    下载: 0 次
    发布日期: 2024-02-11
  • 语言: Java
  • 标签: 一卡通  JSP  

资源简介

JSP+MYSQL校园一卡通系统 源代码

资源截图

代码片段和文件信息

package com.action;

import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dao.DB;
import com.orm.TAdmin;

public class admin_servlet extends HttpServlet
{
public void service(HttpServletRequest reqHttpServletResponse res)throws ServletException IOException 
{
        String type=req.getParameter(“type“);

if(type.endsWith(“adminMana“))
{
adminMana(req res);
}
if(type.endsWith(“adminAdd“))
{
adminAdd(req res);
}
if(type.endsWith(“adminDel“))
{
adminDel(req res);
}
}

public void adminMana(HttpServletRequest reqHttpServletResponse res) throws ServletException IOException
{
List adminList=new ArrayList();
String sql=“select * from t_admin“;
object[] params={};
DB mydb=new DB();
try
{
mydb.doPstm(sql params);
ResultSet rs=mydb.getRs();
while(rs.next())
{
TAdmin admin=new TAdmin();
admin.setUserId(rs.getInt(“userId“));
admin.setUserName(rs.getString(“userName“));
admin.setUserPw(rs.getString(“userPw“));
adminList.add(admin);
    }
rs.close();
}
catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();

req.setAttribute(“adminList“ adminList);
req.getRequestDispatcher(“admin/admin/adminMana.jsp“).forward(req res);
}
public void adminAdd(HttpServletRequest reqHttpServletResponse res)
{
String userName=req.getParameter(“userName“);
String userPw=req.getParameter(“userPw“);
String sql=“insert into t_admin values(??)“;
object[] params={userNameuserPw};
DB mydb=new DB();
mydb.doPstm(sql params);
mydb.closed();

req.setAttribute(“message“ “操作成功“);
req.setAttribute(“path“ “admin?type=adminMana“);

        String targetURL = “/common/success.jsp“;
dispatch(targetURL req res);
}

public void adminDel(HttpServletRequest reqHttpServletResponse res)
{
System.out.println(req.getParameter(“userId“)+“**“);
String sql=“delete from t_admin where userId=“+Integer.parseInt(req.getParameter(“userId“));
object[] params={};
DB mydb=new DB();
mydb.doPstm(sql params);
mydb.closed();

req.setAttribute(“message“ “操作成功“);
req.setAttribute(“path“ “admin?type=adminMana“);

        String targetURL = “/common/success.jsp“;
dispatch(targetURL req res);
}

public void dispatch(String targetURIHttpServletRequest requestHttpServletResponse response) 
{
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
try 
{
    dispatch.forward(request response);
    return;

catch (ServletException e) 
{
                    e.printStackTrace();


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1465  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\.classpath

     文件        285  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\.mymetadata

     文件       1222  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\.project

     文件       3219  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\src\com\action\admin_servlet.java

     文件       2199  2017-09-05 10:20  640JSP+MYSQL一卡通系统\card\src\com\dao\DB.java

     文件       1899  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\src\com\orm\Shenqing.java

     文件       1216  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\src\com\util\EncodingFilter.java

     文件       2379  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\admin\center.jsp

     文件       1558  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\admin\down.jsp

     文件          0  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\admin\index\sysPro.jsp

     文件         61  2014-02-27 17:03  640JSP+MYSQL一卡通系统\card\WebRoot\admin\index.jsp

     文件       3435  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\admin\left.jsp

     文件         88  2013-03-29 12:10  640JSP+MYSQL一卡通系统\card\WebRoot\admin\login.jsp

     文件        779  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\admin\right.jsp

     文件       2899  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\admin\top.jsp

     文件        802  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\common\add_success.jsp

     文件        817  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\common\del_success.jsp

     文件        821  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\common\msg.jsp

     文件        797  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\common\success.jsp

     文件       5008  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\css\base.css

     文件      10287  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\css\css.css

     文件      20274  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\css\style.css

     文件        236  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\fckeditor\editor\css\behaviors\disablehandles.htc

     文件        822  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\fckeditor\editor\css\behaviors\showtableborders.htc

     文件       2648  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\fckeditor\editor\css\fck_editorarea.css

     文件       4088  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\fckeditor\editor\css\fck_internal.css

     文件       1696  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\fckeditor\editor\css\fck_showtableborders_gecko.css

     文件        288  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\fckeditor\editor\css\images\block_address.png

     文件        293  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\fckeditor\editor\css\images\block_blockquote.png

     文件        229  2013-04-12 01:08  640JSP+MYSQL一卡通系统\card\WebRoot\fckeditor\editor\css\images\block_div.png

............此处省略766个文件信息

评论

共有 条评论