简体   繁体   English

我无法使用Spring Boot在jsp中使用c taglib

[英]I cannot use the c taglib in my jsp using spring boot

I'm using Spring Boot and I'm getting this error: 我正在使用Spring Boot并且遇到此错误:

org.apache.jasper.JasperException: The absolute uri: [ http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application org.apache.jasper.JasperException:绝对uri:[ http://java.sun.com/jsp/jstl/core]不能在web.xml或与此应用程序一起部署的jar文件中解析

I was trying to change some dependencies like jstl and jasper versions but it didn't work out 我试图更改一些依赖项,例如jstl和jasper版本,但没有成功

Below pom.xml 在pom.xml下面

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.8.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</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>
        <version>1.2</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/taglibs/standard -->
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency>


    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

I know this is very late to answer this question but it can help someone else who come across the same problem. 我知道现在回答这个问题很晚,但是可以帮助遇到相同问题的其他人。

I removed 我删除了

<version>1.1.2</version>

from jstl dependency and it started working 从jstl依赖,它开始工作

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

    </dependency>

Did you see jstl-support-in-spring-boot 您是否看到jstl-support-in-spring-boot

This problem is caused by server.tomcat.additional-tld-skip-patterns=*.jar. 此问题是由server.tomcat.additional-tld-skip-patterns = *。jar引起的。 I will close this question. 我将结束这个问题。 Kohei TAMURA 田村晃平

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM