filmov
tv
Spring Web MVC – Spring Form Submission - Spring Boot

Показать описание
Spring Web MVC – Spring Form Submission | Spring Boot
Web Form Submission is regular task when developing a Web page. In the tutorial, JavaSampleApproach will introduce you how to use Spring Form Submission when building a Spring MVC Web page.
Related Posts:
1. How to integrate Http Angularjs & Spring Boot
2. How to integrate JQuery Ajax POST/GET & Spring Boot
I. Technology for Spring Form Submission tutorial
– Java 1.8
– Maven: 3.3.9
– Editor: Spring Tool Suite – Version 3.7.3.RELEASE
– Spring Boot: Version: 3.8.0.RELEASE
II. Overview
1. Project Structure
2. Step to do
– Create Spring Boot project
– Create a Customer model
– Create a simple Web Controller.
– Create a html views.
– Run & Check result
III. Practices
1. Create a Spring Boot project
Open Spring Tool Suite, choose File - New - Spring Starter Project, input project’s info. Press Next button, then add needed dependencies:
– For Thymeleaf, choose Template Engines, select Thymeleaf
– For Spring Web MVC, choose Web, then select Web.
Press Finish, Spring Boot project will be created successfully.
2. Create Customer model
3. Create a Simple Web Controller.
Create SimpleWebController with 2 RequestMappings:
– @RequestMapping(value=”/form”, method=RequestMethod.GET): return a html view: form
– @RequestMapping(value=”/form”, method=RequestMethod.POST): to submit customer form, then a html view: “result “
4. Create html views.
– Create 2 html views: “result” & “form”
Place them at: /src/main/resources/template
5. Run & Check result
IV. Source code
SpringMVCFormSubmission
Web Form Submission is regular task when developing a Web page. In the tutorial, JavaSampleApproach will introduce you how to use Spring Form Submission when building a Spring MVC Web page.
Related Posts:
1. How to integrate Http Angularjs & Spring Boot
2. How to integrate JQuery Ajax POST/GET & Spring Boot
I. Technology for Spring Form Submission tutorial
– Java 1.8
– Maven: 3.3.9
– Editor: Spring Tool Suite – Version 3.7.3.RELEASE
– Spring Boot: Version: 3.8.0.RELEASE
II. Overview
1. Project Structure
2. Step to do
– Create Spring Boot project
– Create a Customer model
– Create a simple Web Controller.
– Create a html views.
– Run & Check result
III. Practices
1. Create a Spring Boot project
Open Spring Tool Suite, choose File - New - Spring Starter Project, input project’s info. Press Next button, then add needed dependencies:
– For Thymeleaf, choose Template Engines, select Thymeleaf
– For Spring Web MVC, choose Web, then select Web.
Press Finish, Spring Boot project will be created successfully.
2. Create Customer model
3. Create a Simple Web Controller.
Create SimpleWebController with 2 RequestMappings:
– @RequestMapping(value=”/form”, method=RequestMethod.GET): return a html view: form
– @RequestMapping(value=”/form”, method=RequestMethod.POST): to submit customer form, then a html view: “result “
4. Create html views.
– Create 2 html views: “result” & “form”
Place them at: /src/main/resources/template
5. Run & Check result
IV. Source code
SpringMVCFormSubmission
Комментарии