资源简介
同学录系统同学录系统同学录系统同学录系统同学录系统
代码片段和文件信息
package control;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
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 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();
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 pagerandom = request.getParameter(“pagerandom“)==null?““:request.getParameter(“pagerandom“);
String random = (String)request.getSession().getAttribute(“random“);
if(!pagerandom.equals(random)&&request.getParameter(“a“)!=null)
{
request.setAttribute(“random“ ““);
go(“/admin/login.jsp“ request response);
}
else{
String username = request.getParameter(“luname“);
String password = request.getParameter(“lupass“);
String utype = request.getParameter(“utype“);
request.getSession().setAttribute(“utype“ utype);
List list = dao
.select(“select * from sysuser where uname=‘“
+ username + “‘“);
if (list.size() == 1) {
HashMap map = list.get(0);
List ulist = dao
.select(“select * from sysuser wh
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-04-21 20:00 同学录系统\
目录 0 2018-04-21 19:58 同学录系统\nclassmates\
文件 1419 2017-04-15 12:14 同学录系统\nclassmates\.classpath
目录 0 2017-04-15 12:13 同学录系统\nclassmates\.myeclipse\
文件 306 2017-04-15 12:13 同学录系统\nclassmates\.myme
文件 66 2011-09-14 15:35 同学录系统\nclassmates\.myumldata
文件 1754 2017-04-11 14:39 同学录系统\nclassmates\.project
目录 0 2017-04-16 08:52 同学录系统\nclassmates\.settings\
文件 406 2013-04-06 12:12 同学录系统\nclassmates\.settings\.jsdtscope
文件 382 2017-04-11 14:39 同学录系统\nclassmates\.settings\com.genuitec.eclipse.migration.prefs
文件 281 2017-04-15 12:17 同学录系统\nclassmates\.settings\org.eclipse.core.resources.prefs
文件 395 2017-04-15 12:14 同学录系统\nclassmates\.settings\org.eclipse.jdt.core.prefs
文件 559 2017-04-11 14:39 同学录系统\nclassmates\.settings\org.eclipse.wst.common.component
文件 412 2017-04-11 14:39 同学录系统\nclassmates\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2013-04-06 12:12 同学录系统\nclassmates\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2013-04-06 12:12 同学录系统\nclassmates\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-04-16 08:52 同学录系统\nclassmates\src\
目录 0 2017-04-16 08:52 同学录系统\nclassmates\src\control\
文件 17950 2017-04-15 12:18 同学录系统\nclassmates\src\control\MainCtrl.java
文件 4169 2013-04-06 12:15 同学录系统\nclassmates\src\control\Upload.java
目录 0 2017-04-16 08:52 同学录系统\nclassmates\src\dao\
文件 17397 2017-04-15 20:05 同学录系统\nclassmates\src\dao\CommDAO.java
目录 0 2017-04-16 08:52 同学录系统\nclassmates\src\me
文件 40 2017-04-11 14:39 同学录系统\nclassmates\src\me
目录 0 2017-04-16 08:52 同学录系统\nclassmates\src\util\
文件 25481 2014-12-23 15:24 同学录系统\nclassmates\src\util\Info.java
文件 7139 2013-04-06 12:14 同学录系统\nclassmates\src\util\PageManager.java
文件 1692 2013-04-06 12:14 同学录系统\nclassmates\src\util\SetChar.java
文件 3461 2013-04-06 12:14 同学录系统\nclassmates\src\util\StrUtil.java
文件 1254 2014-12-23 15:32 同学录系统\nclassmates\src\util\test.java
目录 0 2017-04-16 08:52 同学录系统\nclassmates\WebRoot\
............此处省略1547个文件信息
- 上一篇:Office2019.zip
- 下一篇:用友审易数据采集转换工具V5.5(1/2)
评论
共有 条评论