• JSP 装饰公司网站myeclipse开发mysql数据库MVC模式java编程网页设计系统采用mvc框架


    一、源码特点
         JSP 装饰公司网站是一套完善的web设计系统(系统采用serlvet mvc框架进行设计开发),对理解JSP java编程开发语言有帮助,系统具有完整的源代码
    和数据库,系统主要采用B/S模式开发。

    JSP SSH装饰公司网站myeclipse开发mysql


    二、功能介绍
    前台
    首页
    案例展示
    关于我们
    设计师介绍
    公司信息
    后台
    (1)权限管理:对权限信息进行添加、删除、修改和查看
    (2)用户管理:对用户信息进行添加、删除、修改和查看
    (3)关于我们类别管理:对关于我们类别信息进行添加、删除、修改和查看
    (4)关于我们管理:对关于我们信息进行添加、删除、修改和查看
    (5)案例展示管理:对案例展示信息进行添加、删除、修改和查看
    (6)信息类型管理:对信息类型信息进行添加、删除、修改和查看
    (7)信息管理:对信息进行添加、删除、修改和查看
    (8)设计师管理:对设计师信息进行添加、删除、修改和查看
    (9)预约管理:对预约信息进行添加、删除、修改和查看

    控制层代码

    1. package com.servlet;
    2. import java.io.IOException;
    3. import java.io.PrintWriter;
    4. import javax.servlet.ServletException;
    5. import javax.servlet.http.HttpServlet;
    6. import javax.servlet.http.HttpServletRequest;
    7. import javax.servlet.http.HttpServletResponse;
    8. import javax.servlet.http.HttpSession;
    9. import com.bean.xinxi;
    10. import com.dao.xinxiDao;
    11. import java.util.List;
    12. import java.sql.ResultSet;
    13. public class xinxiServlet extends HttpServlet {
    14. public void service(HttpServletRequest request, HttpServletResponse response)
    15. throws ServletException, IOException {
    16. request.setCharacterEncoding("gb2312");
    17. System.out.println("method"+request.getParameter("method"));
    18. String method=(String)request.getParameter("method");
    19. if(method.equals("insert")){//信息添加
    20. insertM(request, response);
    21. }else if(method.equals("list")){//信息列表
    22. ListM(request, response);
    23. }else if(method.equals("delete")){//信息删除
    24. deleteM(request, response);
    25. }else if(method.equals("modifyindex")){//信息修改页面
    26. modifyIndex(request, response);
    27. }
    28. else if(method.equals("modify")){//信息修改
    29. modifyM(request, response);
    30. }else if(method.equals("detail")){//信息详细信息
    31. detailM(request, response);
    32. }else if(method.equals("Plist")){//信息列表信息
    33. PListM(request, response);
    34. }
    35. }
    36. private void insertM(HttpServletRequest request, HttpServletResponse response){//信息添加
    37. xinxiDao dao=new xinxiDao();
    38. xinxi xinxi=new xinxi();
    39. xinxi.setXxid((String)request.getParameter("keyid"));
    40. xinxi.setBt((String)request.getParameter("bt"));
    41. xinxi.setNr((String)request.getParameter("nr"));
    42. xinxi.setLx((String)request.getParameter("lx"));
    43. xinxi.setSj((String)request.getParameter("sj"));
    44. response.setCharacterEncoding("gb2312");
    45. try {
    46. dao.insert(xinxi);
    47. request.setAttribute("flag", "操作成功");
    48. request.getRequestDispatcher("xinxi/xinxiadd.jsp").forward(request, response);
    49. } catch (Exception e) {
    50. e.printStackTrace();
    51. }
    52. }
    53. private void ListM(HttpServletRequest request, HttpServletResponse response){//信息信息列表
    54. ResultSet rs=null;
    55. xinxiDao dao = new xinxiDao();
    56. System.out.println("alist");
    57. String sql="";
    58. response.setCharacterEncoding("gb2312");
    59. try{
    60. rs=dao.qlist(sql);
    61. PrintWriter out = response.getWriter();
    62. request.setAttribute("rs", rs);
    63. request.getRequestDispatcher("xinxi/xinxilist.jsp").forward(request, response);
    64. }catch(Exception e){
    65. e.toString();
    66. e.printStackTrace();
    67. }
    68. }
    69. private void PListM(HttpServletRequest request, HttpServletResponse response){//测试信息列表
    70. ResultSet rs=null;
    71. xinxiDao dao = new xinxiDao();
    72. String str=(String)request.getParameter("Page");
    73. String sql="";
    74. response.setCharacterEncoding("gb2312");
    75. try{
    76. if(str==null){
    77. str="0";
    78. }
    79. rs=dao.qlist(sql);
    80. PrintWriter out = response.getWriter();
    81. request.setAttribute("rs", rs);
    82. request.getRequestDispatcher("xinxi/xinxiPlist.jsp?Page=1").forward(request, response);
    83. }catch(Exception e){
    84. e.toString();
    85. e.printStackTrace();
    86. }
    87. }
    88. private void modifyIndex(HttpServletRequest request, HttpServletResponse response){//信息修改首页
    89. ResultSet rs=null;
    90. response.setCharacterEncoding("gb2312");
    91. xinxiDao dao = new xinxiDao();
    92. String keyid=(String)request.getParameter("keyid");
    93. String sql="";
    94. if(keyid!=null&&!keyid.equals("")){
    95. sql+=" and xxid='"+keyid+"'";
    96. }
    97. try{
    98. rs=dao.qlist(sql);
    99. PrintWriter out = response.getWriter();
    100. request.setAttribute("rs", rs);
    101. request.getRequestDispatcher("xinxi/xinximodify.jsp").forward(request, response);
    102. //response.sendRedirect("xinxi/xinximodify.jsp");
    103. }catch(Exception e){
    104. e.toString();
    105. e.printStackTrace();
    106. }
    107. }
    108. private void detailM(HttpServletRequest request, HttpServletResponse response){//信息详细信息页面
    109. ResultSet rs=null;
    110. response.setCharacterEncoding("gb2312");
    111. xinxiDao dao = new xinxiDao();
    112. String keyid=(String)request.getParameter("keyid");
    113. String sql="";
    114. if(keyid!=null&&!keyid.equals("")){
    115. sql+=" and xxid='"+keyid+"'";
    116. }
    117. try{
    118. rs=dao.qlist(sql);
    119. request.setAttribute("rs", rs);
    120. request.getRequestDispatcher("xinxi/xinxidetail.jsp").forward(request, response);
    121. }catch(Exception e){
    122. e.toString();
    123. e.printStackTrace();
    124. }
    125. }
    126. private void deleteM(HttpServletRequest request, HttpServletResponse response){//信息删除
    127. ResultSet lst=null;
    128. xinxiDao dao = new xinxiDao();
    129. response.setCharacterEncoding("gb2312");
    130. String keyid=(String)request.getParameter("keyid");
    131. try{
    132. dao.delete(keyid);
    133. request.setAttribute("flag", "删除成功");
    134. request.getRequestDispatcher("xinxiServlet?method=list").forward(request, response);
    135. //response.sendRedirect("xinxiServlet?method=list");
    136. }catch(Exception e){
    137. e.toString();
    138. e.printStackTrace();
    139. }
    140. }
    141. private void modifyM(HttpServletRequest request, HttpServletResponse response){//信息修改功能
    142. xinxiDao dao=new xinxiDao();
    143. xinxi xinxi=new xinxi();
    144. xinxi.setXxid((String)request.getParameter("keyid"));
    145. xinxi.setBt((String)request.getParameter("bt"));
    146. xinxi.setNr((String)request.getParameter("nr"));
    147. xinxi.setLx((String)request.getParameter("lx"));
    148. xinxi.setSj((String)request.getParameter("sj"));
    149. response.setCharacterEncoding("gb2312");
    150. try {
    151. dao.modify(xinxi);
    152. PrintWriter out = response.getWriter();
    153. request.setAttribute("flag", "操作成功");
    154. request.getRequestDispatcher("xinxiServlet?method=list").forward(request, response);
    155. //response.sendRedirect("xinxiServlet?method=list");
    156. } catch (Exception e) {
    157. e.printStackTrace();
    158. }
    159. }
    160. }

    dao层代码

    1. package com.dao;
    2. import java.sql.Connection;
    3. import java.sql.PreparedStatement;
    4. import java.sql.ResultSet;
    5. import com.bean.xinxi;
    6. import com.util.DBO;
    7. import java.util.List;
    8. import java.sql.ResultSet;
    9. public class xinxiDao {
    10. private DBO db=null;//
    11. private xinxi xinxi=null;
    12. public void insert(xinxi xinxi) throws Exception{//添加信息
    13. db=new DBO();
    14. db.open();
    15. String sql = "insert into xinxi (bt,nr,lx,sj ) values ('"+xinxi.getBt()+"','"+xinxi.getNr()+"','"+xinxi.getLx()+"','"+xinxi.getSj()+"')";
    16. db.update(sql);
    17. //db.commit();
    18. db.close();
    19. }
    20. public void modify(xinxi xinxi) throws Exception{//修改信息
    21. db=new DBO();
    22. db.open();
    23. String sql = "update xinxi set bt='"+xinxi.getBt()+"',nr='"+xinxi.getNr()+"',lx='"+xinxi.getLx()+"',sj='"+xinxi.getSj()+"' where xxid ='"+xinxi.getXxid()+"'";
    24. db.update(sql);
    25. //db.commit();
    26. db.close();
    27. }
    28. public void delete(String keyid) throws Exception{//删除信息
    29. db=new DBO();
    30. db.open();
    31. String sql = "delete from xinxi where xxid='"+keyid+"'";
    32. db.update(sql);
    33. //db.commit();
    34. db.close();
    35. }
    36. public ResultSet qlist(String sl) throws Exception{//查询信息
    37. db=new DBO();
    38. db.open();
    39. String sql="select * from xinxi where 1=1 ";
    40. if(!sl.equals("")){
    41. sql+=sl;
    42. }
    43. System.out.println("sql="+sql);
    44. return db.query(sql);
    45. }
    46. }

    bean

    1. package com.bean;
    2. public class xinxi {
    3. private String xxid="";//信息编号
    4. private String bt="";//标题
    5. private String nr="";//内容
    6. private String lx="";//类型
    7. private String sj="";//时间
    8. public String getXxid(){
    9. return xxid;
    10. }
    11. public void setXxid(String xxid){
    12. this.xxid = xxid;
    13. }
    14. public String getBt(){
    15. return bt;
    16. }
    17. public void setBt(String bt){
    18. this.bt = bt;
    19. }
    20. public String getNr(){
    21. return nr;
    22. }
    23. public void setNr(String nr){
    24. this.nr = nr;
    25. }
    26. public String getLx(){
    27. return lx;
    28. }
    29. public void setLx(String lx){
    30. this.lx = lx;
    31. }
    32. public String getSj(){
    33. return sj;
    34. }
    35. public void setSj(String sj){
    36. this.sj = sj;
    37. }
    38. }


    三、注意事项
        1、管理员账号:admin 密码:admin 数据库配置文件DBO。java
         2、开发环境为TOMCAT7.0,Myeclipse8.5开发,数据库为Mysql5.0,使用java语言
        3、数据库文件名是jspfzhuangshi.mdf,系统名称zhuangshi
        4、系统首页地址:http://127.0.0.1:8080/zhuangshi/

     

     

     

     

     

  • 相关阅读:
    vue知识点————$nextTick
    如何快速收割小程序第一波红利?
    image.paste()函数【将一张图片粘贴到另一张图片上】
    浏览器打不开DevTools?
    Swift Combine — Publisher、Operator、Subscriber概念介绍
    气传导耳机有哪些品牌?性能不错的气传导耳机分享
    MySQL的join你真的了解吗!!!
    SSM毕设项目 - 基于SSM的毕业设计管理系统(含源码+论文)
    Vue + Element-UI —— 项目实战(七)
    3D着色器(OpenGL)
  • 原文地址:https://blog.csdn.net/qq_41221322/article/details/127038190