ฉันเพิ่งเรียนรู้กรอบ SpringMVC เมื่อเร็ว ๆ นี้และรู้สึกว่ามันสะดวกกว่ามากและลดรหัสซ้ำซ้อนมาก ฉันทำโครงการเล็ก ๆ เพื่อฝึกฝน นี่คือโครงการแอปพลิเคชัน SpringMVC พื้นฐาน MyBatis ไม่ได้ใช้ ฟังก์ชั่นโครงการค่อนข้างสมบูรณ์และฟังก์ชั่นพื้นฐานของการเพิ่มการลบการดัดแปลงและการค้นหาจะรับรู้
สภาพแวดล้อมโครงการ:
-ระบบ: win10
-การพัฒนาสภาพแวดล้อม: eclipseoxygenreleasecandidate3 (4.7)
-JDK เวอร์ชัน: Java1.8 (121)
-mysql: 5.7
-Spring: 4.0
-tomcat: 8.5
เทคนิคที่ใช้:
SpringMvcSpringJSPJDBCJAVABEANJSJSTL
ที่อยู่การเข้าถึง: http: // localhost: 8080/ชื่อโครงการของคุณ/ทั้งหมด
คำแถลง: ฉันเป็นแค่สามเณรที่เพิ่งเริ่มต้นและมีข้อผิดพลาดใด ๆ ในรหัสที่ฉันเขียนอย่างหลีกเลี่ยงไม่ได้ หากคุณพบโปรดชี้ให้เห็นขอบคุณทุกคน
กระบวนการโดยละเอียดมีการโพสต์ด้านล่าง
1. ก่อนสร้างโครงการเว็บ (DynamicWebProject)
ฉันเขียนชื่อโครงการด้วยตัวเองไม่มีรายละเอียดเพิ่มเติม
2. นี่คือโครงสร้างโครงการที่เสร็จสมบูรณ์ของฉัน
ฉันเพิ่งใช้ฟังก์ชั่นและไม่ได้ใช้อินเทอร์เฟซ ฉันใช้เพียงสามคลาสง่าย ๆ คลาสเอนทิตีภายใต้แพ็คเกจถั่วชั้นเรียนการเข้าถึงฐานข้อมูล DAO Layer และคลาสควบคุมอินเตอร์เฟสของเลเยอร์คอนโทรลเลอร์
แพ็คเกจ JAR ที่อ้างอิงทั้งหมดอยู่ในโฟลเดอร์/webcontent/web-inf/lib ซึ่งแตกต่างจากโครงการ Java ธรรมดา
3. รหัส Java เฉพาะ
1. คลาสนักเรียนระดับเอนทิตีก่อนต้องเขียน javabean ฉันเป็นนักเรียนในฐานะ Javabean รหัสรายละเอียดมีดังนี้:
Package Bean; นักเรียนชั้นเรียนสาธารณะ {ID จำนวนเต็มส่วนตัว; // id นักเรียนชื่อสตริงส่วนตัว; // ชื่อนักเรียนชื่อส่วนตัว javascore; // คะแนน Java ส่วนตัวสองเท่า htmlscore; // html คะแนนส่วนตัวสอง cssscore; // css คะแนนส่วนตัวสองเท่า จำนวนเต็มสาธารณะ getId () {return id; } โมฆะสาธารณะ setId (ID จำนวนเต็ม) {this.id = id; } สตริงสาธารณะ getName () {ชื่อคืน; } โมฆะสาธารณะ setName (ชื่อสตริง) {this.name = name; } สาธารณะ double getJavascore () {return javascore; } โมฆะสาธารณะ setJavascore (double javascore) {this.javascore = javascore; } สาธารณะ double gethtmlscore () {return htmlscore; } โมฆะสาธารณะ sethtmlscore (double htmlscore) {this.htmlscore = htmlscore; } สาธารณะ double getcssscore () {return cssscore; } โมฆะสาธารณะ setcssscore (double cssscore) {this.cssscore = cssscore; } สาธารณะ double getTotalscore () {return totalscore; } โมฆะสาธารณะ settotalscore (double totalscore) {this.totalscore = totalsCore; -2. StudentDao คลาสการทำงานการเข้าถึงฐานข้อมูลจะเป็นรหัสของเลเยอร์ DAO นั่นคือเลเยอร์การเข้าถึงข้อมูล นี่คือคลาสที่ห่อหุ้มด้วยสปริง (JDBCTEMPLATE) ซึ่งมีวิธีการบางอย่างสำหรับการใช้งานฐานข้อมูล ไม่จำเป็นต้องเขียนโค้ดซ้ำ ๆ ด้วยตัวเองเพียงแค่เขียนคำสั่ง SQL นี่คือรหัสเฉพาะ:
แพ็คเกจ dao; นำเข้า java.sql.resultset; นำเข้า java.sql.sqlexception; นำเข้า java.sql.types; นำเข้า java.util.list; นำเข้า org.springframework.jdbc.core.jdbctemplate; StudentDao { / ** * @fields JDBCTEMPLATE: TODO * / ส่วนตัว JDBCTEMPLATE JDBCTEMPLATE; / ** * คลาสที่จัดทำโดยฤดูใบไม้ผลิ * * @param Jdbctemplate * ประเภทค่าคืนค่า: void * @author Janinus */ โมฆะสาธารณะ setjdbctemplate (jdbctemplate jdbctemplate) {this.jdbctemplate = jdbctemplate; } / ** * สอบถามนักเรียนทุกคน * * @return ค่าคืนค่าประเภท: รายการ <student> * @author Janinus * / รายการสาธารณะ <Tudent> queryall () {String SQL = "Select ID, ชื่อ, Javascore, HtmlScore, CSSScore จากนักเรียน"; // แมปผลลัพธ์การสืบค้นในชั้นเรียนนักเรียนเพิ่มลงในรายการและส่งคืน return jdbctemplate.query (SQL, New StudentMapper ()); } / ** * Query ตามชื่อ * * @param ชื่อ * @return ค่าคืนค่าประเภท: รายการ <student> * @author Janinus * / รายการสาธารณะ <student> queryByName (ชื่อสตริง) {String SQL = "Select, Name, Javascore, HTMLScore, CSSSCORE ส่งคืน jdbctemplate.query (SQL, New StudentMapper ()); } / ** * เพิ่มนักเรียน * * @param นักเรียน * @return ค่าคืนค่าประเภท: บูลีน * @author Janinus * / บูลีนสาธารณะ addstu (นักเรียนนักเรียน) {String sql = "แทรกลงในนักเรียน (id, ชื่อ, javascore, htmlscore, cssscore) ค่า (0,? return jdbctemplate.update (SQL, วัตถุใหม่ [] {student.getName (), student.getJavascore (), student.gethtmlscore (), student.getcssscore ()}, ใหม่ int [] } / ** * ลบนักเรียน * * @param id * @return ค่าคืนค่าประเภท: บูลีน * @author janinus * / บูลีนสาธารณะ deletestu (ID จำนวนเต็ม) {string sql = "ลบจากนักเรียนที่ id =?"; ส่งคืน jdbctemplate.update (sql, id) == 1; } / ** * อัปเดตข้อมูลนักเรียน * * @Param Student * @return ค่าคืนค่าประเภท: บูลีน * @author janinus * / บูลีนสาธารณะ updatestu (นักเรียนนักเรียน) {string sql = "อัปเดตชุดนักเรียน =?, javascore =?, htmlscore =? Object stuobj [] = วัตถุใหม่ [] {student.getName (), student.getJavascore (), student.gethtmlscore (), student.getcssscore (), student.getId ()}; return jdbctemplate.update (sql, stuobj) == 1; } / ** * ส่งคืนคะแนนรวมของนักเรียนชั้นบน N * * @param num * @return ค่าคืนค่าประเภท: รายการ <student> * @author janinus * / รายการสาธารณะ <นักเรียน> topnum (int num) {string sql = "id, ชื่อ, javascore+htmlscore+cssscoresc return jdbctemplate.query (SQL, ใหม่ Rowmapper <student> () {@Override นักศึกษาสาธารณะ Maprow (Resultset rs, int rownum) พ่น sqlexception {// todo วิธีการที่สร้างอัตโนมัตินักเรียน (RS.SetString (RSTRING) Student.settotalscore (Rs.getDouble (3)); } / ** * * การแม็พฐานข้อมูลนักเรียน * * * @classname studentmapper * @author janinus * @date 27 มิถุนายน 2017 * @version v1.0 * / คลาส studentmapper โดยใช้ Rowmapper <student> {@override นักเรียน maprow นักเรียน(); Student.setId (Rs.getInt (1)); Student.setName (Rs.getString (2)); Student.setJavascore (Rs.getDouble (3)); Student.sethtmlscore (Rs.getDouble (4)); student.setcssscore (Rs.getDouble (5)); กลับมานักเรียน; -3. StudentController คลาสการโต้ตอบส่วนหน้าในที่สุดก็เป็นชั้นควบคุมชั้นเรียนของนักเรียนที่เกี่ยวข้องกับการโต้ตอบของผู้ใช้ คลาสนี้ส่วนใหญ่จะใช้เพื่อรวมส่วนหน้าและส่วนหลังเพื่อให้ได้การโต้ตอบที่สมบูรณ์ นี่คือรหัสเฉพาะ:
Package Controller; นำเข้า org.springframework.context.applicationContext; นำเข้า org.springframework.context.support.classpathxmlapplicationContext; นำเข้า org.springframework.stereotype.controller; org.springframework.web.bind.annotation.requestmapping; นำเข้า Bean.student; นำเข้า dao.studentdao; @controllerpublic studentcontroller { /** * รับข้อมูลนักเรียนทั้งหมดจาก Database @RequestMapping (value = "/all") สตริงสาธารณะ queryall (โมเดลโมเดล) {applicationcontext context = ใหม่ classPathxMlApplicationContext ("ApplicationContext.xml"); // รับ dao studentdao dao = (studentdao) บริบท. getBean ("dao"); model.addattribute ("นักเรียน", dao.queryall ()); model.addattribute ("Tops", dao.topnum (3)); return "index.jsp"; }/** * ค้นหานักเรียนตามชื่อใช้การค้นหาฟัซซี่และส่งคืนผลลัพธ์ไปยัง index.jsp * * @param ชื่อ * @param รุ่น * @return return ค่าประเภท: string * @author janinus */@requestmapping (value = "/queryByName") String Public String classpathxmlapplicationContext ("applicationcontext.xml"); // รับ dao จาก IOC Container studentdao dao = (studentdao) บริบท. getBean ("dao"); model.addattribute ("นักเรียน", dao.QueryByName (ชื่อ)); model.addattribute ("Tops", dao.topnum (3)); return "index.jsp"; }/** * เพิ่มนักเรียนใหม่และส่งคืนผลลัพธ์ไปยังทุกหน้าส่งต่อจากทั้งหมดไปยังหน้าแรก * @param ชื่อ * @param javascore * @param htmlscore * @param cssscore * @param รุ่น * @return return type: @author janinus */@requestmapping HTMLScore, String CSSSCORE, โมเดลโมเดล) {ApplicationContext Context = ใหม่ classPathxMlApplicationContext ("ApplicationContext.xml"); StudentDao Dao = (StudentDao) บริบท GetBean ("Dao"); นักเรียนนักเรียน = นักเรียนใหม่ (); student.setName (ชื่อ); Student.SetJavascore (double.parsedouble (Javascore)); Student.sethtmlscore (double.parsedouble (htmlscore)); student.setcssscore (double.parsedouble (cssscore)); ผลลัพธ์บูลีน = dao.addstu (นักเรียน); if (ผลลัพธ์) model.addattribute ("msg", "<script> Alert ('เพิ่มสำเร็จ!') </script>"); else model.addattribute ("msg", "<script> Alert ('เพิ่มสำเร็จ!') </script>"); กลับ "ทั้งหมด"; }/** * ลบนักเรียนด้วย ID * @param id * @param รุ่น * @return return ค่าประเภท: string * @author janinus */@requestmapping (value = "/deleteById") สตริงสาธารณะ deleteById (string id, โมเดลโมเดล) StudentDao Dao = (StudentDao) บริบท GetBean ("Dao"); ผลลัพธ์บูลีน = dao.deletestu (integer.parseint (id)); if (ผลลัพธ์) model.addattribute ("msg", "<script> Alert ('ลบสำเร็จ!') </script>"); else model.addattribute ("msg", "<script> Alert ('ลบสำเร็จ!') </script>"); กลับ "ทั้งหมด"; }/** * * @param id * @param ชื่อ * @param javascore * @param htmlscore * @param cssscore * @param รุ่น * @return ค่าคืนค่าประเภท: string * @author janinus */@requestmapping (value = "/update") โมเดล) {applicationcontext context = ใหม่ classPathxMlApplicationContext ("ApplicationContext.xml"); StudentDao Dao = (StudentDao) บริบท GetBean ("Dao"); นักเรียนนักเรียน = นักเรียนใหม่ (); Student.setId (Integer.ParseInt (ID)); student.setName (ชื่อ); Student.SetJavascore (double.parsedouble (Javascore)); Student.sethtmlscore (double.parsedouble (htmlscore)); student.setcssscore (double.parsedouble (cssscore)); ผลลัพธ์บูลีน = dao.updatestu (นักเรียน); if (ผลลัพธ์) model.addattribute ("msg", msg ("แก้ไขสำเร็จ")); else model.addattribute ("msg", msg ("การแก้ไขล้มเหลว")); กลับ "ทั้งหมด"; }/** * ข้อความหน้าเพื่อป๊อปอัพ * @param msg * @return ค่าคืนค่าประเภท: สตริง * @author janinus */สตริงสาธารณะ msg (สตริงผงชูรส) {return "<script> การแจ้งเตือน ('" + msg + "') -รหัส Java ทั้งหมดเสร็จสมบูรณ์และเฉพาะการกำหนดค่า XML และหน้าส่วนหน้าเท่านั้นที่เหลืออยู่ด้านล่าง
4. หน้าส่วนหน้า
เนื่องจากเป็นโครงการขนาดเล็กที่เรียบง่าย JS และ CSS ของฉันทั้งหมดอยู่ในหน้าเดียวกันไม่ได้แยกออกจากกันเพียงสองหน้าเท่านั้น
1.index.jsp
โฮมเพจภาพหน้าจอ
แก้ไข
รหัสรายละเอียด:
<%@ page language = "java" contentType = "ข้อความ/html; charset = utf-8" pageencoding = "utf-8"%> <%@ taglib คำนำหน้า = "fn" uri = "http://java.sun.com/jsp/jstl/functions uri = "http://java.sun.com/jsp/jstl/core" %> <! doctype html> <html lang = "en"> <head> <meta charset = "utf-8"> <title> }. ทั้งหมด {ความกว้าง: 40%; มาร์จิ้น: 20px 100px; TEXT-ALIGN: CENTER; ความสูง: 300px; ลอย: ซ้าย; } ตาราง {ความกว้าง: 80%; มาร์จิ้น: 20px auto; ขนาดตัวอักษร: 14px; ล้น: อัตโนมัติ; } #tab02 {width: 80%; มาร์จิ้น: 20px auto; ขนาดตัวอักษร: 14px; } ตาราง th, ตาราง td {ขอบด้านล่าง: 1px #000 solid; ความสูงบรรทัด: 23px; } #EDIT_COMM {WIDTH: 500PX; มาร์จิ้น: 20px auto; ชายแดนซ้าย: 3px Solid #000; แสดง: ไม่มี; } #ADD_COMM {WIDTH: 500PX; มาร์จิ้น: 20px auto; ชายแดนซ้าย: 3px Solid #000; } #all_comm {ความสูง: 600px; } .edit_stu {width: 200px; ความสูง: 30px; ความเป็นมา: #FFF; Font-Family: "Microsoft Ya Black Light", "Arial Black"; ขนาดตัวอักษร: 18px; ชายแดน: ไม่มี; ขอบด้านล่าง: 1px Solid #000; มาร์จิ้น: 20px 10px; } </style> <script src = "http://code.jquery.com/jQuery-latest.js"> </script> <script type = "text/javascript"> $ (function () {$ ("#cancel") $ ("อินพุต"). addclass ("edit_stu"); } ฟังก์ชั่น add_reg () {var name = $ ("#add_edit_name"). val (); var javascore = $ ("#add_edit_java"). val (); var htmlscore = $ ("#add_edit_html"). val (); var cssscore = $ ("#add_edit_css"). val (); var namenot = name! = null && name! = ''; var javascorenot = javascore! = null && javascore! = ''; var htmlscorenot = htmlscore! = null && htmlscore! = ''; var cssscorenot = cssscore! = null && cssscore! = ''; if (namenot & javascorenot && htmlscorenot && cssscorenot) กลับมาจริง; อื่นกลับมาเป็นเท็จ } function delete_stu (id) {var result = ยืนยัน ("มันถูกลบหรือไม่?"); ถ้า (ผลลัพธ์) window.location.href = "deleteById? id =" rel = "nofollow ภายนอก" +id; } ฟังก์ชั่น edit_stu (id) {var name = $ ("#name"+id) .Text (); var java = $ ("#java"+id) .Text (); var html = $ ("#html"+id) .Text (); var css = $ ("#css"+id) .Text (); $ ("#edit_id"). val (id); $ ("#edit_name"). val (ชื่อ); $ ("#edit_java"). Val (Java); $ ("#edit_html"). val (html); $ ("#edit_css"). Val (CSS); $ ("#add_comm"). fadeout (); $ ("#edit_comm"). fadein (); } </script> <body> $ {msg} <h1 align = "center"> การจัดการนักเรียน </h1> <div id = "all_comm"> <h2> นักเรียนทั้งหมด </h2> <table id = "รายการ"> <td> <td> id </td> <td> ชื่อ </td> <td> <td> <td> คะแนน CSS </td> <td> การดำเนินการ </td> </td> </tr> <c: foreach items = "$ {นักเรียน}" var = "นักเรียน"> <tr> <td id = "id $ {student.id}"> $ {student.id} </td> <td> <td id = "java $ {student.id}"> $ {student.javascore} </td> <td id = "html $ {student.id}"> $ {student.htmlscore} </td> <td id = "css $ {นักเรียน onclick = "delete_stu ($ {student.id})"> ลบ </a> | <a onclick = "edit_stu ($ {student.id})"> แก้ไข </a> </td> </tr> </c: foreach> </table> <table id = "tab02" <td> id </td> <td> ชื่อ </td> <td> คะแนนรวม </td> </tr> <c: foreach items = "$ {tops}" var = "นักเรียน" varstatus = "i"> <tr> <td> $ {i.index+1} ชื่อ </td> } </td> <td> $ {student.name} </td> <td id = "ชื่อ $ {student.id} t"> $ {student.totalscore} </td> </tr> </c: foreach> <H2> ค้นหานักเรียน </h2> <form action = "queryByName" method = "post"> <อินพุต type = "text" placeholder = "ชื่อนักเรียน" ชื่อ = "ชื่อ"> <อินพุตประเภท = "ส่ง" value = "ค้นหานักเรียน"> </form> <h2 id = "edit_title"> name = "name" /> <อินพุต type = "text" placeholder = "คะแนน java" name = "javascore" /> <อินพุต type = "text" placeholder = "คะแนน html" name = "htmlscore" /> <อินพุตประเภท = "ข้อความ" id = "edit_Comm"> <h2 id = "edit_title"> แก้ไขนักเรียน </h2> <form action = "update" method = "post"> <อินพุต type = "text" placeholder = "id ที่จะแก้ไขคือ" idit_id "name =" id "value =" ID id = "edit_name" name = "name" /> <input type = "text" placeholder = "คะแนน Java" id = "edit_java" name = "javascore"> <input type = "text" plessholder = "html คะแนน" idit_html id = "edit_css" name = "cssscore"/> <อินพุต type = "subment" value = "ยืนยันการแก้ไข"/> <อินพุต type = "ปุ่ม" value = "ยกเลิกการปรับเปลี่ยน" id = "ยกเลิก"2. login.jsp
<%@ page language = "java" contentType = "ข้อความ/html; charset = utf-8" pageencoding = "utf-8"%> <! doctype html สาธารณะ "-// w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd"><html> <head> <meta http-equiv =" content-type "content =" text/html; charset = utf-8 "> <title> rel = "ภายนอก nofollow" rel = "ภายนอก nofollow"> ป้อนหน้าแรก </a> </h1> </body> </html>
5. การกำหนดค่าไฟล์โดยละเอียด
1. ApplicationContext.xml
นี่คือไฟล์การกำหนดค่าของคอนเทนเนอร์ IOC ของสปริงที่ใช้ในการใช้การฉีดพึ่งพา ต่อไปนี้เป็นรหัสเฉพาะ:
<? xml version = "1.0" การเข้ารหัส = "utf-8"?> <beans xmlns = "http://www.springframework.org/schema/beans" xmlns: xsi = "http://ww.w3.org/2001/xml xmlns: context = "http://www.springframework.org/schema/context" xmlns: tx = "http://www.springframework.org/schema/tx" xmlns: aop = "http:/ XSI: schemalocation = "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://ww.springframework http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd "dataBase datata name-DataBase <!-การโหลดคลาสไดรเวอร์-> <property name = "driverclassName" value = "com.mysql.jdbc.driver"> </property> <!-ที่อยู่การเข้าถึงฐานข้อมูล-> <property name = "url" value = "jdbc: mysql: // localhost: 3306/test" value = "root"> </คุณสมบัติ> <!-รหัสผ่านการเข้าถึงฐานข้อมูล-> <property name = "รหัสผ่าน" value = "123123"> </คุณสมบัติ> </ebean> <!-การจัดการธุรกรรมฐานข้อมูลที่จัดทำโดยฤดูใบไม้ผลิ-> <bean id = "txManager"> Transaction-manager = "txManager"/> <!-กำหนดค่าคลาสเอนทิตี Javabean-> <bean id = "studentbean"> <!-การกำหนดค่าอัตโนมัติ-> </epean> <!-คลาสการทำงานของฐานข้อมูล คลาสเลเยอร์การกำหนดค่านี้ไม่ถูกต้อง-> <bean id = "คอนโทรลเลอร์"> <property name = "dao" ref = "dao"> </property> </ebean> </ebeans>
2. SpringMvc-servlet.xml, คลาสการกำหนดค่าสปริง MVC
เราได้ใช้รหัส Servlet ส่วนใหญ่สำหรับเราและเราจำเป็นต้องเขียนการใช้งานธุรกิจเท่านั้น ด้านล่างคือรหัสเฉพาะ
<? xml version = "1.0" การเข้ารหัส = "utf-8"?> <beans xmlns = "http://www.springframework.org/schema/beans" xmlns: xsi = "http://ww.w3.org/2001/xml xmlns: p = "http://www.springframework.org/schema/p" xmlns: บริบท = "http://www.springframework.org/schema/contex http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context สแกนคลาสภายใต้แพ็คเกจที่ระบุ-> <บริบท: Component-Scan base-base-package = "Controller" /> </epeans>
3. web.xml
นี่คือไฟล์กำหนดค่าของโครงการเว็บและต่อไปนี้เป็นรหัสหลัก:
<? xml version = "1.0" encoding = "utf-8"?> <web-app xmlns = "http://java.sun.com/xml/ns/javaee" xmlns: xsi = "http://ww.w3.org/2001/xml XSI: schemalocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">-configure <side-name> encodingFilter </filter-name> <filter-class> org.springframework.web.filter.characterencodingFilter </filter-class> <init-param> <param-name> การเข้ารหัส </param-name> อินเทอร์เฟซ-> <welcome-file-list> <welcome-file>/ทั้งหมด </welcome-file> <welcome-file> index.html </welcome-file> <welcome-file> index.htm </welcome-file> </welcome-file-list> <! <servlet-class> org.springframework.web.servlet.dispatcherservlet </servlet-class> <load-on-startup> 1 </load-on-startup> </servlet> <servlet-mapping>
6. สรุปโครงการและภาคผนวก
โครงการนี้เป็นโปรแกรมการฝึกฝนประจำวันของฉัน เพื่อให้มีความเชี่ยวชาญมากขึ้นฉันได้ตรวจสอบกระบวนการที่สมบูรณ์อีกครั้งและคุ้นเคยกับมันมาก
ภาคผนวกไปยังแพ็คเกจ JAR ที่ใช้สำหรับโครงการ:
นอกจากแพ็คเกจสปริงแล้วยังมีแพ็คเกจ Jar MySQL-JBDC และแพ็คเกจ JSTL JAR
ดาวน์โหลดที่อยู่:
แพ็คเกจ Spring Framework Jar (เวอร์ชันเสริม): เว็บไซต์อย่างเป็นทางการของฤดูใบไม้ผลิ
mysql-jdbc.jar (รุ่นเสริม): เว็บไซต์ทางการ MySQL
jstl.jar (รุ่นเสริม): ที่อยู่อย่างเป็นทางการของ Maven
ข้างต้นเป็นเนื้อหาทั้งหมดของบทความนี้เกี่ยวกับตัวอย่างที่สมบูรณ์ของ Spring MVC ที่ใช้การเพิ่มการลบการดัดแปลงและการค้นหาฐานข้อมูล MySQL ฉันหวังว่ามันจะเป็นประโยชน์กับทุกคน เพื่อนที่สนใจสามารถอ้างถึงเว็บไซต์นี้ต่อไปได้:
คำอธิบายโดยละเอียดเกี่ยวกับการกำหนดค่าของโมดูลเว็บในฤดูใบไม้ผลิ
การแนะนำสไตล์ REST SpringMVC และรหัสการใช้งาน
SpringMVC Interceptor ใช้การลงชื่อเข้าใช้ครั้งเดียว
หากมีข้อบกพร่องใด ๆ โปรดฝากข้อความไว้เพื่อชี้ให้เห็น ขอบคุณเพื่อนที่ให้การสนับสนุนเว็บไซต์นี้!