资源简介

实验室开放预约程序,该系统为网页程序,利用的开发工具myeclipse和mysql,代码简单高效

资源截图

代码片段和文件信息

package control;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;

import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUpload;
import org.apache.commons.fileupload.RequestContext;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.servlet.ServletRequestContext;


import util.Info;

import dao.CommDAO;

public class MainCtrl extends HttpServlet {

public MainCtrl() {
super();
}

public void destroy() {
super.destroy(); // Just puts “destroy“ string in log
// Put your code here
}

public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
this.doPost(request response);
}

public void go(String urlHttpServletRequest request HttpServletResponse response)
{
try {
request.getRequestDispatcher(url).forward(request response);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}

public void gor(String urlHttpServletRequest request HttpServletResponse response)
{
try {
response.sendRedirect(url);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}

public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
        response.setContentType(“text/html“);
PrintWriter out = response.getWriter();
HttpSession session = request.getSession();
HashMap user = (HashMap)session.getAttribute(“admin“);
String ac = request.getParameter(“ac“);
if(ac==null)ac=““;
CommDAO dao = new CommDAO();
String date = Info.getDateStr();
String today = date.substring(010);
String tomonth = date.substring(07);

//登录
if(ac.equals(“login“))
{
String username = request.getParameter(“uname“);
String password = request.getParameter(“upass“);
String utype = request.getParameter(“utype“);

String sql = “select * from sysuser where utype=‘“+utype+“‘ and uname=‘“+username+“‘ and upass=‘“+password+“‘“;

List userlist = dao.select(sql);
if(userlist.size()!=1)
{
request.setAttribute(“error“ ““);
go(“/admin/login

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         897  2018-04-22 16:48  .classpath
     目录           0  2018-04-23 12:01  .myeclipse\
     文件         304  2015-04-20 18:34  .mymetadata
     文件        1228  2015-04-06 10:46  .project
     目录           0  2018-04-22 16:45  .settings\
     文件        1040  2012-03-22 21:47  .settings\com.genuitec.eclipse.j2eedt.core.prefs
     文件         629  2018-04-22 16:45  .settings\org.eclipse.jdt.core.prefs
     目录           0  2018-04-22 17:04  WebRoot\
     目录           0  2018-04-22 16:46  WebRoot\WEB-INF\
     目录           0  2018-04-22 17:17  WebRoot\WEB-INF\classes\
     目录           0  2018-04-22 17:17  WebRoot\WEB-INF\classes\control\
     文件       21808  2018-04-22 17:44  WebRoot\WEB-INF\classes\control\MainCtrl.class
     文件        3518  2018-04-22 17:17  WebRoot\WEB-INF\classes\control\Upload.class
     目录           0  2018-04-22 17:17  WebRoot\WEB-INF\classes\dao\
     文件       13833  2018-04-22 17:17  WebRoot\WEB-INF\classes\dao\CommDAO.class
     目录           0  2018-04-22 17:17  WebRoot\WEB-INF\classes\util\
     文件       21013  2018-04-22 17:17  WebRoot\WEB-INF\classes\util\Info.class
     文件        5826  2018-04-22 17:17  WebRoot\WEB-INF\classes\util\PageManager.class
     文件        1846  2018-04-22 17:17  WebRoot\WEB-INF\classes\util\SetChar.class
     文件        3402  2018-04-22 17:17  WebRoot\WEB-INF\classes\util\StrUtil.class
     目录           0  2018-04-22 16:48  WebRoot\WEB-INF\lib\
     文件       57779  2011-02-11 10:45  WebRoot\WEB-INF\lib\commons-fileupload-1.2.1.jar
     文件       87776  2011-02-11 10:45  WebRoot\WEB-INF\lib\commons-io-1.3.2.jar
     文件      611696  2011-02-11 10:45  WebRoot\WEB-INF\lib\jxl.jar
     文件      495944  2012-11-29 19:12  WebRoot\WEB-INF\lib\mysql-connector-java-5.0.4-bin.jar
     文件     1879860  2013-05-17 09:34  WebRoot\WEB-INF\lib\ojdbc5.jar
     文件      518072  2018-03-18 11:58  WebRoot\WEB-INF\lib\sqljdbc.jar
     文件      537303  2018-03-18 14:27  WebRoot\WEB-INF\lib\sqljdbc4.jar
     文件        1498  2018-04-22 16:46  WebRoot\WEB-INF\web.xml
     目录           0  2018-04-22 16:56  WebRoot\admin\
     文件       11242  2015-04-06 18:38  WebRoot\admin\chooseexperimentcx.jsp
............此处省略312个文件信息

评论

共有 条评论