Creating a View - a JSP

Let's create welcome.jsp in the src/main/webapp/WEB-INF/views/welcome.jsp folder with the following content:

    <html> 
<head>
<title>Welcome</title>
</head>
<body>
<p>Welcome! This is coming from a view - a JSP</p>
</body>
</html>

This is a simple HTML with head, body, and some text in the body.

Spring MVC has to map the string returned from the welcome method to the real JSP at /WEB-INF/views/welcome.jsp. How does this magic happen?

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset