Search code examples
javaspringspring-bootjstl

Spring boot - Adding JSTL dependency causes a problem


I am new to Spring boot. I want to use jstl tag for JSP page. For that I have added the following dependency

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

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap</artifactId>
            <version>3.3.6</version>
        </dependency>

        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap-datepicker</artifactId>
            <version>1.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
            <version>1.9.1</version>
        </dependency>

        <!-- Use MySQL Connector-J -->

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <!-- Hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
        </dependency>

    </dependencies>

Whenever I add the jstl dependency the project wont start but will start when removing it.

Deploying on Apache Tomcat 8.0.27.0 profile mode: false debug mode: true force redeploy: true Undeploying ... undeploy?path=/demo OK - Undeployed application at context path /demo In-place deployment at

Following error appears while running app.

C:\Users\Nishan Dhungana\Documents\NetBeansProjects\SpringBootTest\target\demo-0.0.1-SNAPSHOT deploy?config=file%3A%2FC%3A%2FUsers%2FNISHAN%7E1%2FAppData%2FLocal%2FTemp%2Fcontext3041249382478705791.xml&path=/demo FAIL - Deployed application at context path /demo but context failed to start


Solution

  • Add this dependency too in your pom.xml

    <dependency>
         <groupId>jstl</groupId>
         <artifactId>jstl</artifactId>
         <version>1.2</version>
    </dependency>
    

    Hope this might help you!