# Spring MVC exercise > ## What is Spring * First SpringMVC Program: https://openhome.cc/Gossip/SpringGossip/FirstSpringMVC.html * Spring Tutorial: https://www.javatpoint.com/spring-tutorial * Java & Spring-MVC Tutorial: http://www.codedata.com.tw/java/java-tutorial-the-4th-class-1-spring-webmvc/ * Spring Chinese Document: https://linesh.gitbooks.io/spring-mvc-documentation-linesh-translation/ * Spring 框架: http://tw.gitbook.net/spring/spring_web_mvc_framework.html > ## MVC * Model: * Design: https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/302835/ * View: * Bootstrap-popup window: * https://www.tutorialrepublic.com/faq/how-to-launch-bootstrap-modal-on-page-load.php * https://getbootstrap.com/docs/4.0/components/modal/ * Controller: * Get checkboxes values example: https://www.cnblogs.com/EasonJim/p/7470534.html * Get dropdown box values example: * https://www.mkyong.com/spring-mvc/spring-mvc-dropdown-box-example/ * https://www.tutorialspoint.com/springmvc/springmvc_dropdown.htm * Dao / Service / Controller: https://blog.csdn.net/lailai186/article/details/86085535 > ## Java Beans * JavaBeans是Java中一種特殊的類,可以將多個對象封裝到一個對象(bean)中。特點是可序列化,提供無參建構元,提供getter方法和setter方法訪問對象的屬性。名稱中的「Bean」是用於Java的可重用軟體組件的慣用叫法。 * 優點: * Bean可以控制它的屬性、事件和方法是否暴露給其他程序。 * Bean可以接收來自其他對象的事件,也可以產生事件給其他對象。 * 有軟體可用來配置Bean。 * Bean的屬性可以被序列化,以供日後重用。 * 要成為JavaBean類,則必須遵循關於命名、建構元、方法的特定規範。有了這些規範,才能有可以使用、復用、替代和連接JavaBeans的工具。 ``` 規範如下: 有一個public的無參數建構元。 屬性可以通過get、set、is(可以替代get,用在布爾型屬性上)方法或遵循特定命名規範的其他方法訪問。 可序列化。 ``` > ## JSP * JSTL core: * https://openhome.cc/Gossip/ServletJSP/IntroduceJSTL.html * https://openhome.cc/Gossip/ServletJSP/FlowTag.html * https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/501457/ ![](https://i.imgur.com/ZwqtD7H.png) * ==form==: https://blog.csdn.net/J080624/article/details/56501910 > ## Servlet * Implement(forward): https://dotblogs.com.tw/alantsai/2013/10/03/servlet-forward * Life Cycle: http://www.runoob.com/servlet/servlet-life-cycle.html >## Example * ==Setting xml file==: * [hello world eg.]https://dotblogs.com.tw/raylee/2019/04/15/143704 * [complete details]https://wiki.jikexueyuan.com/project/spring/web-mvc-framework.html * [request procedure]https://ithelp.ithome.com.tw/articles/10157918 * Employee CURD: https://www.javatpoint.com/spring-mvc-crud-example * File Upload: * [jdbc]https://www.websparrow.org/spring/how-to-insert-image-in-database-using-spring-mvc * https://www.javatpoint.com/spring-mvc-file-upload * [Chinese]https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/532123/ * https://www.websparrow.org/spring/how-to-insert-image-in-database-using-spring-mvc * Display Image: https://stackoverflow.com/questions/6055856/display-image-in-spring-mvc * ==Show Image by AJAX==: https://www.itread01.com/content/1540956123.html * Store Image to SqlServer: * https://www.java-tips.org/other-api-tips-100035/69-jdbc/203-how-to-storeretrieve-image-tofrom-sqlserver.html * https://www.sqlshack.com/upload-multiple-images-sql-server/ * Login * [registration & bootstrap]https://hellokoding.com/registration-and-login-example-with-spring-xml-configuration-maven-jsp-and-mysql/ * [security] https://o7planning.org/en/10305/simple-login-java-web-application-using-spring-mvc-spring-security-and-spring-jdbc * https://www.onlinetutorialspoint.com/spring/spring-mvc-login-form-example.html * https://o7planning.org/en/10311/spring-mvc-and-spring-jdbc-transaction-tutorial >## SQL * Query two tables : [JOIN]https://www.fooish.com/sql/join.html * Compare two tables: http://dwgeek.com/quick-best-way-compare-two-tables-sql.html/ * 子查詢: http://it001.pixnet.net/blog/post/352392155-%E7%AC%AC%E4%B8%80%E7%AF%87%3A--it%E8%AE%80%E6%9B%B8%E5%AE%A4-sql%E8%AA%9E%E6%B3%95%E5%AD%B8%E7%BF%92--%E5%AD%90%E6%9F%A5%E8%A9%A2 * 資料儲存型態: * date convert: * https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/319101/ * https://www.cnblogs.com/panxuejun/p/7279997.html * https://blog.csdn.net/AlbertFly/article/details/76259523 * https://stackoverflow.com/questions/41911605/convert-and-save-date-with-spring-mvc * bootstrap datepicker: * https://stackoverflow.com/questions/44168521/send-date-from-bootstrap-datepicker-to-spring-controller-with-timezone * https://ithelp.ithome.com.tw/articles/10188890 * jquery datepicker: https://stackoverflow.com/questions/37304922/jquery-datepicker-with-spring-mvc-passing-date-from-view-to-controller-sends-n > ## Spring Security * https://openhome.cc/Gossip/Spring/SpringSecurity.html * https://ithelp.ithome.com.tw/articles/10160537 ###### tags: `spring-mvc`