JSP page/file is not rendering in Spring Boot application
Sometimes you might be facing the problem that JSP page/file is not rendering in Spring Boot application. It will be downloaded when you call the controller that renders your JSP page/file.
All we know, Spring Boot uses the embedded Tomcat Server which does not include JSP compiler jar, so the Spring Boot application failed to compile the JSP page/file into the servlet and page will be downloaded.
To resolve this problem, you need to add JSP compiler jar i.e. Tomcat Jasper in your Spring Boot application.
pom.xml
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>9.0.1</version>
</dependency>Choose an appropriate version of Tomcat Jasper matches with your application. Check out the MVN Repository.
Similar Posts
- Spring Boot- How to change default context path
- Versioning of REST API in Spring Boot: Types and Benefits
- Spring 5 method replacement example
- Spring 5 MVC Java Based Configuration Example
- Spring Boot + Activiti Script Task Example
- Spring AOP + AspectJ @Before, @After, @AfterReturning, @AfterThrowing, and @Around Annotation Example
- Spring AOP After Returning Advice example using XML configuration
- Spring AOP pointcut example using XML configuration
- Spring Boot + Jasper Report + MySQL Database Example
- Spring Data JPA Derived Query Methods Example