Thank you so much for your kind words and support! I really appreciate it and I'm glad you're enjoying my videos. I'll do my best to keep creating content that you'll love!
Hey, I was following along, but my page is not getting rendered, instead it just shows the string that we return from the controller that is "login", can you please explain how it is able to fetch the login page from the controller, did you do any other configuration before the video? like in application.properties file or anywhere else? UPDATE: Just figured out, I was using @RestController and when I changed it to @Controller then the page started rendering. What is Controller? A Controller is a Java class that is used to handle HTTP requests in a Spring or Spring Boot application. It is responsible for receiving incoming requests from a client, processing them, and returning an appropriate response. A Controller typically returns a View object, which is responsible for rendering a web page that can be viewed by the user. What about RestController? On the other hand, a RestController is a special type of Controller that is used to handle RESTful requests in a Spring or Spring Boot application. It is similar to a Controller in that it receives incoming requests from a client, processes them, and returns an appropriate response. However, instead of returning a View object, a RestController returns a ResponseBody object, which contains the data that is sent back to the client in a format such as JSON or XML.
Thank you for reaching out and providing an update on your experience with the tutorial. I appreciate your diligence in troubleshooting the issue, and I'm glad to hear that you were able to identify the root cause. In your case, the distinction between @Controller and @RestController played a crucial role. A @Controller is designed for traditional web applications, where it returns a View object responsible for rendering a web page. On the other hand, a @RestController is intended for handling RESTful requests, where it returns a ResponseBody object containing data formatted as JSON or XML. It's great that you figured it out by switching to @Controller, and your description of the difference between the two annotations is accurate. If you have any more questions or if there's anything else I can assist you with, feel free to ask. I'm here to help.