Spring Boot-添加JSTL依赖关系会导致问题

时间:2018-09-04 17:03:06

标签: java spring spring-boot jstl

我是Spring Boot的新手。我想为JSP页面使用jstl标签。为此,我添加了以下依赖项

<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>

每当我添加jstl依赖项时,该项目就不会启动,但是在删除时会启动。

  

在Apache Tomcat 8.0.27.0上部署       个人资料模式:false       调试模式:true       强制重新部署:true取消部署... undeploy?path = / demo确定-上下文路径/ demo处的未部署应用程序

运行应用程序时出现以下错误。

  

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   失败-在上下文路径/ demo上部署了应用程序,但是上下文失败   开始

1 个答案:

答案 0 :(得分:1)

也在您的pom.xml

中添加此依赖项
<dependency>
     <groupId>jstl</groupId>
     <artifactId>jstl</artifactId>
     <version>1.2</version>
</dependency>

希望这对您有帮助!