Creating a View

Let's create a view using the model attribute name that was set in the model in the controller. Let's create a simple JSP in the WEB-INF/views/welcome-model-map.jsp path:

    Welcome ${name}! This is coming from a model-map - a JSP

One thing to note is this:

  • ${name}: This uses the Expression Language (EL) syntax to access the attribute from the model.

Here is a screenshot of how this would look on the screen when the URL is hit:

Get Mastering Spring 5.0 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.