资源简介
采用mvc结构开发的,利用了jsp、servlet、javabean,采用jdbc作为数据库连接,采用mysql数据库。
代码片段和文件信息
package com.atoz.survey.control;
import com.atoz.survey.dao.PaperDao;
import com.atoz.survey.dao.mysqlimpl.PaperDaoImpl;
import com.atoz.survey.po.Paper;
import com.atoz.survey.po.User;
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 java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class AddPaper extends HttpServlet {
/**
* Constructor of the object.
*/
public AddPaper() {
super();
}
/**
* Destruction of the servlet.
*/
@Override
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
*/
@Override
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
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
*/
@Override
public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
System.out.println(“进入AddPaper servlet“);
PaperDao paperDao = new PaperDaoImpl();
Paper paper = new Paper();
HttpSession session = request.getSession();
User user = (User) session.getAttribute(“userInfo“);
System.out.println(“输出用户id“);
System.out.println(user.getUserId());
int userId = user.getUserId();
paper.setUserId(userId);
String papertitle0 = request.getParameter(“papertitle“);
String papertitle = new String(papertitle0.getBytes(“ISO-8859-1“)“utf-8“);
paper.setPapertitle(papertitle);
String paperTypeString = request.getParameter(“paperType“);
int paperType = Integer.parseInt(paperTypeString);
paper.setPaperType(paperType);
String paperSummary0 = request.getParameter(“paperSummary“);
String paperSummary = new String(paperSummary0.getBytes(“ISO-8859-1“)“utf-8“);
paper.setPaperSummary(paperSummary);
String paperBg = request.getParameter(“paperBg“);
paper.setPaperBg(paperBg);
//发布日期
Date date = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss“);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-01-09 19:59 wenwen\
目录 0 2018-04-08 23:39 wenwen\.idea\
目录 0 2018-01-09 19:59 wenwen\.idea\artifacts\
文件 281 2017-06-29 23:43 wenwen\.idea\artifacts\wenwen_war.xm
文件 655 2017-07-01 22:56 wenwen\.idea\artifacts\wenwen_war_exploded.xm
文件 637 2017-12-04 22:14 wenwen\.idea\compiler.xm
目录 0 2018-04-08 23:34 wenwen\.idea\dataSources\
文件 754 2018-04-08 23:34 wenwen\.idea\dataSources.local.xm
文件 889 2017-07-02 09:22 wenwen\.idea\dataSources.xm
目录 0 2018-04-08 23:34 wenwen\.idea\dataSources\d02b4419-d184-4c23-8dda-6df427227049\
文件 5056 2017-07-02 09:22 wenwen\.idea\dataSources\d02b4419-d184-4c23-8dda-6df427227049.xm
文件 124 2018-04-08 23:34 wenwen\.idea\dataSources\d02b4419-d184-4c23-8dda-6df427227049\storage.xm
目录 0 2018-04-08 23:34 wenwen\.idea\dataSources\d02b4419-d184-4c23-8dda-6df427227049\_src_\
目录 0 2018-04-08 23:34 wenwen\.idea\dataSources\d02b4419-d184-4c23-8dda-6df427227049\_staging_\
文件 200 2017-07-01 22:01 wenwen\.idea\encodings.xm
目录 0 2018-01-09 19:59 wenwen\.idea\libraries\
文件 199 2017-07-01 23:00 wenwen\.idea\libraries\junit4_4.xm
文件 514 2017-06-29 23:43 wenwen\.idea\libraries\Maven__aopalliance_aopalliance_1_0.xm
文件 616 2017-06-29 23:43 wenwen\.idea\libraries\Maven__commons_collections_commons_collections_3_2_1.xm
文件 572 2017-06-29 23:43 wenwen\.idea\libraries\Maven__commons_logging_commons_logging_1_1_1.xm
文件 644 2017-06-29 23:43 wenwen\.idea\libraries\Maven__com_fasterxm
文件 595 2017-06-29 23:43 wenwen\.idea\libraries\Maven__com_fasterxm
文件 623 2017-06-29 23:43 wenwen\.idea\libraries\Maven__com_fasterxm
文件 499 2017-06-29 23:43 wenwen\.idea\libraries\Maven__com_google_guava_guava_17_0.xm
文件 493 2017-06-29 23:43 wenwen\.idea\libraries\Maven__com_mchange_c3p0_0_9_5_1.xm
文件 598 2017-06-29 23:43 wenwen\.idea\libraries\Maven__com_mchange_mchange_commons_java_0_2_10.xm
文件 455 2017-06-29 23:43 wenwen\.idea\libraries\Maven__junit_junit_4_12.xm
文件 469 2017-06-29 23:43 wenwen\.idea\libraries\Maven__log4j_log4j_1_2_17.xm
文件 574 2017-06-29 23:43 wenwen\.idea\libraries\Maven__mysql_mysql_connector_java_5_1_22.xm
文件 556 2017-06-29 23:43 wenwen\.idea\libraries\Maven__org_apache_commons_commons_lang3_3_4.xm
文件 532 2017-06-29 23:43 wenwen\.idea\libraries\Maven__org_hamcrest_hamcrest_core_1_3.xm
............此处省略245个文件信息
- 上一篇:Android实时曲线.rar
- 下一篇:网上书店管理系统(java-web项目)
相关资源
- JSP2BSQL图书借阅管理系统源代码2B可执
- 校园交易平台 jsp
- JAVAJSP在线收藏夹源码
- JSP+SQL毕业论文选题管理系统
- jsp在线考试系统217958
- JSP +MYSQL工资管理系统(毕业设计)
- JSP+SQL电费管理系统
- JSP学生评奖评优管理系统 毕业设计
- 仓库管理系统JSP+ACCESS
- JSP+MYSQL网上订餐管理系统
- NIIT jsp 试题 有答案
- 音乐网站JSP+SERVLET
- jsp+Servlet+JavaBean 购物系统
- jsp在线答疑系统 jsp网上答疑系统
- 网上书店-课程设计JSP+JavaBean+Servle
- Java用JSP和Servlet做的网上书店
- jsp+mysql 学生管理系统
- 基于JSP的停车场管理系统调试通过的
- 关于一个基于jsp的BBS,带数据库
- 基于 JSP+Struts2医院挂号系统
- jsp开发案例 很好很好,适合所有开
- 网上书店jsp + sql 整套
- jsp论坛源代码的实现留言,回复
- java与matlab混合编程jsp调用matlab网页显
- jsp+serlvet增删改查员工系统
- 超市收银JSP+JAVABEAN+Servlet
- web开发课程设计
- jsp+mysql火车订票系统.zip
- 在线考试系统,oracle,jsp
- 图书管理系统jsp源代码
评论
共有 条评论