資源簡介
基于java的會員系統,用來練手的一個會員系統,適合新手。
代碼片段和文件信息
package?lipan;
import?java.io.*;
import?java.sql.*;
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?javax.servlet.http.HttpSession;
import?com.sun.corba.se.pept.transport.Connection;
public?class?HandleUpload?extends?HttpServlet?{
private?String?logname;
private?object?ql;
/**
?*?Constructor?of?the?object.
?*/
public?HandleUpload()?{
super();
}
/**
?*?Destruction?of?the?servlet.?
?*/
public?void?destroy()?{
super.destroy();?//?Just?puts?“destroy“?string?in?log
//?Put?your?code?here
}
/**
?*?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?{
doPost(requestresponse);
}
/**
?*?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?{
HttpSession?session=request.getSession(true);
//Login?login=(Login)session.getAttribute(“login“);???//獲取登錄時的Javabean
/*boolean?ok=true;
if(login==null){
ok=false;
response.sendRedirect(“login.jsp“);//重定向到登陸界面
}*/
}
public?void?uploadFileMethod(HttpServletRequest?request?HttpServletResponse?response)
throws?ServletException?IOException?SQLException?{
UploadFile?upFile=new?UploadFile();
String?backNews=““;
try{HttpSession?session=request.getSession(true);
request.setAttribute(“upFile“?upFile);
String?tempFileName=(String)session.getId();
File?f1=new?File(tempFileName);
FileOutputStream?o=new?FileOutputStream(f1);
InputStream?in=request.getInputStream();
byte?b[]=new?byte[10000];
int?n;
while((n=in.read(b))!=-1){
o.write(b?0?n);
}
o.close();
in.close();
RandomAccessFile?random=new?RandomAccessFile(f1“r“);
int?second=1;
String?secondLine=null;
while(second<=2){
secondLine=random.readLine();
second++;
}
int?position=secondLine.lastIndexOf(‘\\‘);//截取文件名
String?fileName=secondLine.substring(position?secondLine.length()-1);
byte?cc[]=fileName.getBytes(“ISO-8859-1“);
fileName?=new?S
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-10-15?20:32??李攀的\
?????目錄???????????0??2018-06-04?20:03??李攀的\photo\
?????文件?????????362??2018-05-29?22:38??李攀的\photo\.classpath
?????目錄???????????0??2018-10-15?20:32??李攀的\photo\.myeclipse\
?????文件?????????288??2018-05-29?22:38??李攀的\photo\.myme
?????文件????????1688??2018-05-29?22:38??李攀的\photo\.project
?????目錄???????????0??2018-06-04?20:03??李攀的\photo\.settings\
?????文件?????????500??2018-05-29?22:38??李攀的\photo\.settings\.jsdtscope
?????文件??????????94??2018-05-29?22:38??李攀的\photo\.settings\com.genuitec.eclipse.core.prefs
?????文件?????????330??2018-05-29?22:38??李攀的\photo\.settings\org.eclipse.jdt.core.prefs
?????文件?????????453??2018-05-29?22:38??李攀的\photo\.settings\org.eclipse.wst.common.component
?????文件?????????252??2018-05-29?22:38??李攀的\photo\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2018-05-29?22:38??李攀的\photo\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2018-05-29?22:38??李攀的\photo\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2018-06-04?20:03??李攀的\photo\WebRoot\
?????目錄???????????0??2018-06-04?20:03??李攀的\photo\WebRoot\me
?????文件??????????36??2018-05-29?22:38??李攀的\photo\WebRoot\me
?????目錄???????????0??2018-06-04?20:03??李攀的\photo\WebRoot\WEB-INF\
?????目錄???????????0??2018-06-04?20:03??李攀的\photo\WebRoot\WEB-INF\classes\
?????目錄???????????0??2018-06-04?20:03??李攀的\photo\WebRoot\WEB-INF\classes\lipan\
?????文件????????6422??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\classes\lipan\HandleUpload.class
?????文件?????????952??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\classes\lipan\UploadFile.class
?????目錄???????????0??2018-06-04?20:03??李攀的\photo\WebRoot\WEB-INF\lib\
?????文件??????161563??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\lib\Tidy.jar
?????文件???????33202??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\lib\axis-ant.jar
?????文件?????1599570??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\lib\axis.jar
?????文件????????3272??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\lib\com.genuitec.eclipse.reporting.oda_7.5.0.200905281536.jar
?????文件?????6690627??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\lib\com.ibm.icu_4.4.2.v20110208.jar
?????文件?????1782380??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\lib\com.lowagie.text_2.1.7.v201004222200.jar
?????文件???????30117??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\lib\commons-cli-1.0.jar
?????文件???????71442??2018-05-29?22:38??李攀的\photo\WebRoot\WEB-INF\lib\commons-discovery-0.2.jar
............此處省略261個文件信息
- 上一篇:Euclidea_4.17破解版
- 下一篇:jsp酒店管理完整系統
評論
共有 條評論