91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.36MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-10-24
  • 語言: Java
  • 標簽:

資源簡介

jsp+serlvet實現的增刪改查員工管理系統,后臺使用Mysql

資源截圖

代碼片段和文件信息

package?com.wtu.controller;

import?java.io.IOException;
import?java.lang.reflect.Method;

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

public?class?baseServlet?extends?HttpServlet{

@Override
public?void?service(HttpServletRequest?req?HttpServletResponse?resp)
throws?ServletException?IOException?{
resp.setContentType(“text/html;charset=UTF-8“);//處理響應編碼
req.setCharacterEncoding(“UTF-8“);
/*
?*?通過反射來實現,
?*?1獲取方法名
?*?2.獲取當前類Class對象??this.getClass();
?*?3.獲取與該方法名對應的Method對象???getMethod(String?name?Class...?parameterTypes)?
String?name:方法名
Class...?parameterTypes:方法的參數類型???HttpServletRequest.class??HttpServletResponse.class
?*?4.通過Method對象來調用invoke(thisreqresp)????就相當于調用了???methodName()
?*???假設獲取的methodName??為??addCustomer
?*/
//獲取請求方法?在請求參數中??附帶一個額外的參數???:該參數是一個方法名
String?methodName?=?req.getParameter(“method“);
//獲取當前類的Class對象
Class?cl?=?this.getClass();
//獲取與methodName?對應的Method對象、
Method?method?=?null;
try?{
method?=?cl.getMethod(methodName?HttpServletRequest.classHttpServletResponse.class);
}?catch?(Exception?e)?{
throw?new?RuntimeException(“不能獲取“+methodName+“的Method對象“);
}?

String?path?=?null;
try?{
//通過method對象來調用invoke()?方法?該方法的返回值就是執(zhí)行methodName()返回值
//this.methodName(reqresp);
path?=?(String)method.invoke(this?reqresp);//采用反射調用

}?catch?(Exception?e)?{
e.printStackTrace();
}?

if?(path?==?null)?{
System.out.println(“什么也不做!!!“);
return?;
}
/*
?*?在此處轉發(fā)或者重定向
?*/
String[]?arr?=?path.split(“:“);
/*
?*?判斷arr[0]如果是redirect?那么久重定向,如果是forward??那么久轉發(fā)??如果是null?那就什么都不做
?*?如果是其他那么久拋個異常,提示不能進行此操作
?*/
if(“redirect“.equals(arr[0])){
resp.sendRedirect(req.getContextPath()+arr[1]);
}else?if(“forward“.equals(arr[0])){
req.getRequestDispatcher(arr[1]).forward(req?resp);
}else?{
throw?new?RuntimeException(“操作有誤,只能轉發(fā)或者重定向,或者什么也不做“);
}
}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1278??2018-01-14?14:14??customer\.classpath

?????文件????????297??2013-12-24?13:08??customer\.mymetadata

?????文件???????1751??2013-12-24?13:35??customer\.project

?????文件????????500??2013-12-24?13:08??customer\.settings\.jsdtscope

?????文件????????247??2018-01-13?15:27??customer\.settings\com.genuitec.eclipse.migration.prefs

?????文件????????395??2013-12-24?13:08??customer\.settings\org.eclipse.jdt.core.prefs

?????文件????????550??2018-01-14?10:50??customer\.settings\org.eclipse.wst.common.component

?????文件????????359??2018-01-13?15:27??customer\.settings\org.eclipse.wst.common.project.facet.core.xml

?????文件?????????49??2013-12-24?13:08??customer\.settings\org.eclipse.wst.jsdt.ui.superType.container

?????文件??????????6??2013-12-24?13:08??customer\.settings\org.eclipse.wst.jsdt.ui.superType.name

?????文件????????556??2018-01-14?11:53??customer\src\c3p0-config.xml

?????文件???????2585??2018-01-14?15:13??customer\src\com\wtu\controller\baseServlet.java

?????文件???????2549??2018-01-14?16:08??customer\src\com\wtu\controller\CustomerServlet.java

?????文件???????3491??2018-01-14?16:03??customer\src\com\wtu\dao\CustomerDao.java

?????文件???????1743??2018-01-14?14:43??customer\src\com\wtu\entity\Customer.java

?????文件????????920??2018-01-14?15:48??customer\src\com\wtu\entity\PageBean.java

?????文件????????668??2018-01-14?15:59??customer\src\com\wtu\service\CustomerService.java

?????文件????????471??2018-01-14?10:25??customer\src\com\wtu\utils\DateUtil.java

?????文件???????1219??2018-01-14?10:55??customer\src\com\wtu\utils\JDBCUtils.java

?????文件?????????25??2018-01-13?15:27??customer\src\meta-INF\MANIFEST.MF

?????文件???????3543??2018-01-14?11:16??customer\WebRoot\add.jsp

?????文件???????3460??2013-12-24?14:46??customer\WebRoot\edit.jsp

?????文件????????781??2013-12-24?14:45??customer\WebRoot\frame.jsp

?????文件????????105??2013-12-24?13:38??customer\WebRoot\index.jsp

?????文件????????919??2013-12-24?13:49??customer\WebRoot\jquery\calendar-green.gif

?????文件????????269??2013-12-24?13:49??customer\WebRoot\jquery\calendar.gif

?????文件?????????94??2013-12-24?13:49??customer\WebRoot\jquery\calendar.js

?????文件?????216840??2013-12-24?13:49??customer\WebRoot\jquery\jquery-1.5.1.js

?????文件???????1427??2013-12-24?13:49??customer\WebRoot\jquery\jquery.datepick-zh-CN.js

?????文件???????4008??2013-12-24?13:49??customer\WebRoot\jquery\jquery.datepick.css

............此處省略54個文件信息

評論

共有 條評論