Spring MVC JSTL Configuration Example

Learn to configure JSTL support to Spring MVC application using maven build tool. Learn to enable JSTL tags in Spring MVC application.

1. JSTL maven dependencies



2. Configure InternalResourceViewResolver to resolve JSTL views

2.1. Spring JSTL Java Configuration

public ViewResolver configureViewResolver() 
	InternalResourceViewResolver viewResolve = new InternalResourceViewResolver();
	return viewResolve;

2.2. Spring JSTL XML Configuration

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
	<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>
	<property name="prefix">
	<property name="suffix">

3. Use JSTL tags in JSP files

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 

<h1>Welcome message : <c:out value="${message}"></c:out></h1>

Happy Learning !!

Read More:

JSTL Library

Oldest Most Voted
Inline Feedbacks
View all comments

Comments are closed for this article!

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.