【jsp】java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

已添加jstl依赖, 如下:

        <!-- jstl依赖 -->
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

启动服务器, 未报错;

访问首页, 报错500:

java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

 

google后到Stack Overflow, 得到答案, 增加两个依赖jstl-apijstl-impl:

     <!-- jstl -->
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <!-- jstl-api -->
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl-api</artifactId>
            <version>1.2</version>
        </dependency>
        <!-- jstl-impl -->
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>jstl-impl</artifactId>
            <version>1.2</version>
        </dependency>

问题得以解决.

 

posted on 2017-06-29 15:12  扣子开了  阅读(11827)  评论(1编辑  收藏  举报

导航