资源简介
基于javaweb的增删改查,链接数据库什么的,简单的增删改查,等等的
代码片段和文件信息
package controller;
import java.io.PrintWriter;
import entity.student;
import service.stuservice;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class addstucontroller extends HttpServlet {
protected void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
request.setCharacterEncoding(“utf-8“);
stuservice ss=new stuservice();
int sid=Integer.parseInt(request.getParameter(“sid“));
String sname=request.getParameter(“sname“);
String sex=request.getParameter(“sex“);
int age=Integer.parseInt(request.getParameter(“age“));
student stu=new student(sidsnamesexage);
boolean flag=ss.addstuservice(stu);
response.setCharacterEncoding(“utf-8“);
response.setContentType(“text/html; charset=UTF-8“);
PrintWriter out=response.getWriter();
if(flag) {
out.println(“添加成功“);
}else {
out.println(“添加失败“);
}
response.setHeader(“refresh“ “1;URL=add.jsp“);
}
protected void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
// TODO Auto-generated method stub
doGet(request response);
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-12-13 17:58 mvc\
文件 1457 2018-12-13 13:25 mvc\.classpath
文件 903 2018-12-12 17:41 mvc\.project
目录 0 2018-12-13 17:58 mvc\.settings\
文件 567 2018-12-12 17:41 mvc\.settings\.jsdtscope
文件 364 2018-12-12 17:41 mvc\.settings\org.eclipse.jdt.core.prefs
文件 461 2018-12-12 17:41 mvc\.settings\org.eclipse.wst.common.component
文件 345 2018-12-12 17:41 mvc\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2018-12-12 17:41 mvc\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2018-12-12 17:41 mvc\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2018-12-13 17:58 mvc\build\
目录 0 2018-12-13 17:58 mvc\build\classes\
目录 0 2018-12-13 17:58 mvc\build\classes\controller\
文件 2041 2018-12-13 15:59 mvc\build\classes\controller\addstucontroller.class
文件 1766 2018-12-13 16:01 mvc\build\classes\controller\deletestucontroller.class
文件 1380 2018-12-13 16:44 mvc\build\classes\controller\findallcontroller.class
文件 1574 2018-12-13 16:49 mvc\build\classes\controller\findstubyidcontroller.class
文件 2068 2018-12-13 17:56 mvc\build\classes\controller\updatestucontroller.class
目录 0 2018-12-13 17:58 mvc\build\classes\dao\
文件 4062 2018-12-13 17:50 mvc\build\classes\dao\studao.class
目录 0 2018-12-13 17:58 mvc\build\classes\entity\
文件 1750 2018-12-13 14:39 mvc\build\classes\entity\student.class
目录 0 2018-12-13 17:58 mvc\build\classes\service\
文件 1545 2018-12-13 17:45 mvc\build\classes\service\stuservice.class
目录 0 2018-12-13 17:58 mvc\build\classes\util\
文件 1982 2018-12-13 13:28 mvc\build\classes\util\jdbcutil.class
目录 0 2018-12-13 17:58 mvc\src\
目录 0 2018-12-13 17:58 mvc\src\controller\
文件 1338 2018-12-13 15:59 mvc\src\controller\addstucontroller.java
文件 1191 2018-12-13 16:01 mvc\src\controller\deletestucontroller.java
文件 841 2018-12-13 16:44 mvc\src\controller\findallcontroller.java
............此处省略29个文件信息
评论
共有 条评论