Create a new Spring Boot project called ex22_requestMapping. Be sure to pay close attention to your project name, group,…

Create a new Spring Boot project called ex22_requestMapping. Be sure to pay close attention to your project name, group,…

Question:

    

Transcribed Image Text:

Create a new Spring Boot project called ex22_requestMapping. Be sure to pay close attention to your project name, group, and package info, but otherwise, the defaults from last time are probably fine. We only want Spring Web and Thymeleaf again today. Following the examples used in the lecture, create a HomeController class in a ca.sheridancollege. .controllers package and annotate it with @Controller. Create a method for @GetMapping for requests to “/” and dispatch (return!) to “index”. Create an HTML page called index.html in the templates directory. Inside, create a form asking your users to set an appointment time of their preference. This means you need Time: Step 2 Now, modify your Controller with a PostMapping method for a resource of “/formPost” so that it dispatches returns a String as well and dispatches (returns) to “working”. This one’s on you! It’s easy! Just like the @GetMapping, but for POST and with different resources! Create a new class called Appointment in a ca.sheridancollege. .beans package. Inside, create the following fields: A private String firstName . A private String email A private LocalDate appointment Date A private LocalTime appointment Time Use Eclipse to generate Getters and Setters, as well as a toString method, for your bean properties. Create a new class called Appointment in a ca.sheridancollege. .beans package. Inside, create the following fields: A private String firstName A private String email A private LocalDate appointment Date A private LocalTime appointmentTime Use Eclipse to generate Getters and Setters, as well as a toString method, for your bean properties. Now at the PostMapping method in your Controller, pull out the information! To do this, you need to use @Request Param. You might say, for example, @RequestParam String firstName. Be careful – the variable names have to line up with your form field names or it won’t work! When you get to appointment Date and appointmentTime, refer to the lecture to give Spring Boot a bit of extra help converting their data types! This is the only tricky part for today, and it’s honestly still pretty easy! Look right at the end of the lecture notes! Information in hand, set the info into a new instance of Appointment you create… Appointment appointment = new Appointment (); appointment.setFirstName (firstName); // etc! Complete the appointment fields! Please fill in all the Appointment property fields! Finally, print your appointment! Take a screenshot of your printed console info from a successful form post and submit it to SLATE here as a screenshot using your name as the filename! Only JPEGS or PNGs with your name as the filename please! extra help converting their data types! This is the only tricky part for today, and it’s honestly still pretty easy! Look right at the end of the lecture notes! Information in hand, set the info into a new instance of Appointment you create… Appointment appointment = new Appointment (); (firstName); appointment.setFirstName // etc! Complete the appointment fields! Please fill in all the Appointment property fields! Finally, print your appointment! Take a screenshot of your printed console info from a successful form post and submit it to SLATE here as a screenshot using your name as the filename! Only JPEGS or PNGs with your name as the filename please!

Expert Answer:

Answer rating: 100% (QA)

To create a simple interactive website for sending appointment dates and times to a server using Spring Boot you can follow these steps Step 1 Create
View the full answer