0

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

James S
  • 98
  • 3
Joshua Majebi
  • 1,110
  • 4
  • 16
  • 34
  • the default compile goal for spring boot is `Jar`. As is documented in spring docs Jar executable in spring boot does not support Jsps. https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#web.servlet.embedded-container.jsp-limitations . Try to see if you can configure your project in tools suite to be deployed as a war instead and it may appear as an option – Panagiotis Bougioukos Apr 15 '22 at 08:26
  • Switching to War didn't fix It. Thanks all the same. – Joshua Majebi Apr 15 '22 at 08:59
  • try the following. Help Tab -> Install new software -> Work with "All available sites" -> Web, XML, Java EE and OSGi Enterprise development -> install. Restart and try again to introduce JSPs – Panagiotis Bougioukos Apr 15 '22 at 10:27

1 Answers1

0

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