Implementing the review creation web page

Thus far, we have created views for user registration and login, as well as a homepage for logged in users to peruse reviews posted on the platform. We must now work on the view that facilitates the creation of these reviews. As always, first, before creating the view, let us work on an action that will be in charge of rendering our to-be-developed view to users. Open up the ApplicationController class and add the following method to it:

@GetMapping("/create-review")fun createReview(model: Model, principal: Principal): String { model.addAttribute("principal", principal)  return "create-review"}

The createReview() action handles HTTP GET requests to the /create-review request path by returning a

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.