Adding jsp to spring boot project

404 Views Asked by At

I am starting a new project and I am trying to configure spring boot as a web project to use jsp's. I am using Spring Tools Suite 4.

I have added the spring web option while setting up.

I have added the following in the application.properties

spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp

I have also have the following dependencies in my pom file

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
    </dependency>
    <!-- Need this to compile JSP -->
    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</artifactId>
        <scope>provided</scope>
    </dependency>
</dependencies>

When I try to add a tsp to the main/webapp/WEB-INF/jsp folder I dont get the jsp option.

enter image description here

1

There are 1 best solutions below

0
On

Try installing the plugin from eclipse marketplace

Go to help -> eclipse marketplace

Then search Eclipse Java EE Developer Tools

Install it and restart your IDE