-
大小: 1.71MB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2023-10-26
- 語言: Java
- 標簽: java??簽到系統(tǒng)??
資源簡介
java實現(xiàn)的簡易簽到系統(tǒng),web版的,含數(shù)據(jù)庫文件,可以直接運行

代碼片段和文件信息
package?user;
import?java.io.IOException;
import?java.io.PrintWriter;
import?java.sql.ResultSet;
import?java.sql.SQLException;
import?java.util.ArrayList;
import?javax.servlet.RequestDispatcher;
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?com.sun.mail.iap.Response;
public?class?check_mail?extends?HttpServlet?{
/**
?*?The?doGet?method?of?the?servlet.?
?*
?*?This?method?is?called?when?a?form?has?its?tag?value?method?equals?to?get.
?*?
?*?@param?request?the?request?send?by?the?client?to?the?server
?*?@param?response?the?response?send?by?the?server?to?the?client
?*?@throws?ServletException?if?an?error?occurred
?*?@throws?IOException?if?an?error?occurred
?*/
public?void?doGet(HttpServletRequest?request?HttpServletResponse?response)
throws?ServletException?IOException?{
this.doPost(request?response);
}
/**
?*?The?doPost?method?of?the?servlet.?
?*
?*?This?method?is?called?when?a?form?has?its?tag?value?method?equals?to?post.
?*?
?*?@param?request?the?request?send?by?the?client?to?the?server
?*?@param?response?the?response?send?by?the?server?to?the?client
?*?@throws?ServletException?if?an?error?occurred
?*?@throws?IOException?if?an?error?occurred
?*/
public?void?doPost(HttpServletRequest?request?HttpServletResponse?response)
throws?ServletException?IOException?{
String?id=““;
String?sql=““;
HttpSession?session=request.getSession();
id=(String)?session.getAttribute(“id“);
String?Class=(String)session.getAttribute(“class“);
DB?db=new?DB();
ResultSet?r=null;
if(Class.equals(“1“))
sql=“select?*?from?mail_information?m?where?m.id=‘“+id+“‘?order?by?m.時間?desc“;
else
sql=“select?*?from[user]?u?mail_information?m?where?u.賬號=‘“+id+“‘a(chǎn)nd?m.組長=u.姓名?order?by?m.時間?desc“;
r=db.executeQuery(sql);
try?{
ArrayList?list?=?new?ArrayList();
while(r.next())
{
mail?m=new?mail();
m.setId(r.getString(“id“));
m.setName(r.getString(“姓名“));
m.setGroup(r.getString(“組長“));
m.setContent(r.getString(“原因“));
m.setDate(r.getString(“時間“));
m.setDay(r.getString(“天數(shù)“));
list.add(m);
}
System.out.println(list.size());
session.setAttribute(“l(fā)ist“?list);
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
String?path=“./check_mail.jsp“;
RequestDispatcher?dispatcher?=?request.getRequestDispatcher(path);
dispatcher.forward(request?response);
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????606??2012-05-17?20:45??簽到系統(tǒng)\signsystem\.classpath
?????文件????????303??2012-05-17?20:45??簽到系統(tǒng)\signsystem\.myme
?????文件???????1753??2012-05-17?20:45??簽到系統(tǒng)\signsystem\.project
?????文件????????500??2012-05-17?20:45??簽到系統(tǒng)\signsystem\.settings\.jsdtscope
?????文件????????395??2012-05-17?20:45??簽到系統(tǒng)\signsystem\.settings\org.eclipse.jdt.core.prefs
?????文件????????468??2012-05-17?20:45??簽到系統(tǒng)\signsystem\.settings\org.eclipse.wst.common.component
?????文件????????252??2012-05-17?20:45??簽到系統(tǒng)\signsystem\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2012-05-17?20:45??簽到系統(tǒng)\signsystem\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2012-05-17?20:45??簽到系統(tǒng)\signsystem\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件???????2721??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\check_mail.java
?????文件???????2933??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\check_random.java
?????文件???????3462??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\check_sign.java
?????文件???????5225??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\DB.java
?????文件???????2215??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\findpassword.java
?????文件???????3502??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\login_in.java
?????文件????????879??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\mail.java
?????文件???????2844??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\regist.java
?????文件???????2619??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\reset_info.java
?????文件???????2730??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\sendEmail.java
?????文件???????1084??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\sign_detail.java
?????文件???????3208??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\sign_in.java
?????文件????????967??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\sign_info.java
?????文件???????2083??2012-05-17?20:45??簽到系統(tǒng)\signsystem\src\user\write_mail.java
?????文件???????4397??2012-05-17?20:45??簽到系統(tǒng)\signsystem\WebRoot\check_mail.jsp
?????文件???????4004??2012-05-17?20:45??簽到系統(tǒng)\signsystem\WebRoot\check_sign.jsp
?????文件???????1614??2012-05-17?20:45??簽到系統(tǒng)\signsystem\WebRoot\del.jsp
?????文件???????3143??2012-05-17?20:45??簽到系統(tǒng)\signsystem\WebRoot\findpassword.jsp
?????文件???????5760??2012-05-17?20:45??簽到系統(tǒng)\signsystem\WebRoot\image\04.gif
?????文件???????9633??2012-05-17?20:45??簽到系統(tǒng)\signsystem\WebRoot\image\1.gif
?????文件???????9121??2012-05-17?20:45??簽到系統(tǒng)\signsystem\WebRoot\image\10.gif
............此處省略79個文件信息
評論
共有 條評論