资源简介
myweb01.zip

代码片段和文件信息
package action;
import model.Emp;
import model.Page;
import util.Dblink;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
public class EmpAction extends HttpServlet {
public void service(HttpServletRequest request HttpServletResponse response) throws UnsupportedEncodingException {
request.setCharacterEncoding(“UTF-8“);
response.setContentType(“text/html;charset=UTF-8“);
String url = request.getRequestURI();//获取action 的url
//substring(xy)是从x到y截取字符串 lastIndexOf是从字符串中找到这个子字符串出现的最后位置
url = url.substring(url.lastIndexOf(“/“)url.lastIndexOf(“.“));
if (url.equals(“/reg“)){
try {
if (reg(responserequest)>0){
response.sendRedirect(“index.jsp“);
}else {
response.sendRedirect(“my.jsp“);
}
} catch (SQLException | ClassNotFoundException | IOException e) {
e.printStackTrace();
}
}else if (url.equals(“/so“)){
String currentPage = request.getParameter(“currentPage“);
if (currentPage==null||currentPage==““){
currentPage=“1“;
}
int current = Integer.parseInt(currentPage);
try {
ArrayList allEmp = getArr();
int countPa = allEmp.size();
int pageNum = 5;
ArrayList currentEmp = getEmpPage(currentpageNum);
Page page = new Page();
page.setCountPage(countPa);
page.setCurrentPage(current);
page.setPageNum(pageNum);
page.setList(currentEmp);
request.setAttribute(“ps“page);
request.getRequestDispatcher(“list.jsp“).forward(requestresponse);
} catch (SQLException | ServletException | IOException | ClassNotFoundException e) {
e.printStackTrace();
}
}else if (url.equals(“/del“)){
String id = request.getParameter(“id“);
try {
int result = deleteUser(Integer.parseInt(id));
if (result>0){
response.sendRedirect(“so.do“);
}
} catch (SQLException | ClassNotFoundException | IOException e) {
e.printStackTrace();
}
}else if (url.equals(“/Add“)){
try {
addDo(requestresponse);
} catch (SQLException | ClassNotFoundException | ServletException | IOException e) {
e.printSt
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-04-19 10:38 myweb01\
目录 0 2020-04-20 21:53 myweb01\.idea\
文件 540 2020-04-20 09:48 myweb01\.idea\compiler.xm
目录 0 2020-04-19 10:49 myweb01\.idea\inspectionProfiles\
文件 813 2020-04-19 10:49 myweb01\.idea\inspectionProfiles\Project_Default.xm
文件 660 2020-04-19 10:25 myweb01\.idea\misc.xm
文件 12688 2020-04-20 21:53 myweb01\.idea\workspace.xm
文件 81 2020-04-19 10:24 myweb01\myweb01.iml
文件 2718 2020-04-19 10:38 myweb01\pom.xm
目录 0 2020-04-19 10:24 myweb01\src\
目录 0 2020-04-19 10:41 myweb01\src\main\
目录 0 2020-04-19 10:46 myweb01\src\main\java\
目录 0 2020-04-20 21:49 myweb01\src\main\java\action\
文件 8268 2020-04-20 21:49 myweb01\src\main\java\action\EmpAction.java
目录 0 2020-04-20 10:42 myweb01\src\main\java\model\
文件 514 2020-04-19 10:42 myweb01\src\main\java\model\Emp.java
文件 1094 2020-04-20 10:42 myweb01\src\main\java\model\Page.java
目录 0 2020-04-19 10:49 myweb01\src\main\java\util\
文件 386 2020-04-19 10:49 myweb01\src\main\java\util\Dbl
目录 0 2020-04-20 14:59 myweb01\src\main\webapp\
目录 0 2020-04-19 10:43 myweb01\src\main\webapp\WEB-INF\
文件 443 2020-04-19 10:43 myweb01\src\main\webapp\WEB-INF\web.xm
文件 495 2020-04-20 11:30 myweb01\src\main\webapp\add.jsp
文件 52 2020-04-19 10:24 myweb01\src\main\webapp\index.jsp
文件 2353 2020-04-20 11:30 myweb01\src\main\webapp\list.jsp
文件 706 2020-04-20 14:59 myweb01\src\main\webapp\updata.jsp
目录 0 2020-04-20 14:59 myweb01\target\
目录 0 2020-04-20 14:54 myweb01\target\classes\
目录 0 2020-04-20 14:54 myweb01\target\classes\action\
文件 6673 2020-04-20 14:54 myweb01\target\classes\action\EmpAction.class
目录 0 2020-04-20 10:53 myweb01\target\classes\model\
............此处省略29个文件信息
相关资源
- SpringBoot+H2+mybatis-plus59130
- 登录注册界面.zip48872
- Web Api 通过文件流 文件到本地
- 数字华容道
-
大数据。基于Hba
se的网站日志分析系 - Servlet API中文文档
- SSM+Shiro+redis实现单点登陆
- jstl-api-1.2和jstl-impl-1.2
- 基于MVC模式的会员管理系统
- 编写简单的RMI程序 多线程web 服务器
- 基于web的毕业设计开题报告
- 国内一家大型软件公司内部的正规软
- 仿windows记事本
- web班级网站设计代码
- websocket实现一对一聊天
- GUI银行管理系统
- 3DWebGIS 3DWebGIS
- web js虚拟键盘(中英文切换)
- 超市收银系统eclipse access大学课程设计
- WinCE中的Web Service调用
- 模拟ATM柜员机系统--连接数据库
- WEB系统界面设计模板(很漂亮)
- web民族旅游网站源码
- A*算法的2D演示(带源码)
- 代码审查表和代码审查实例
- 基于Web的高校教务管理系统的设计与
- 通过webservice上传和下载文件
- 仿126 网易 163 邮箱 界面
- Tomcat6.x
- 简单的行编辑器
评论
共有 条评论