spring boot 启动jetty,jstl不能加载

Gavin__ 发布于 2015/04/15 14:06
阅读 4K+
收藏 0

工程中使用了Spring Boot,Spring Boot引入Jetty,通过spring-boot:run来启动工程

jetty的jar是通过spring boot引入的,自己另外单独引入的话也是同样的错误

工程启动后访问到包含c标签的页面报错org.apache.jasper.JasperException: /pages/logins.jsp(3,65) PWC6188: 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

pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  
  
  <modelVersion>4.0.0</modelVersion>
  <groupId>Acumeninnovation</groupId>
  <artifactId>DocStation</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>DocStation</name>
  <url>http://maven.apache.org</url>
  
  
    <!-- 私服仓库地址   -->
  <repositories>  
        <repository>  
            <id>nexus</id>  
            <url>http://192.168.1.1:5478/nexus/content/groups/public/</url>  
            <releases>  
                <enabled>true</enabled>  
            </releases>  
            <snapshots>  
                <enabled>true</enabled>  
            </snapshots>  
        </repository>  
  </repositories>
  
  <!-- 自定义属性 -->
  <properties>
  	<spring.version>4.1.6.RELEASE</spring.version>
  	<jdk.version>1.8</jdk.version>
  	<servlet-api.version>3.0.1</servlet-api.version>
  </properties>

	<!-- Spring Boot Parent-->
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.3.RELEASE</version>
  </parent> 


  <dependencies>
     
    	<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-jetty</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
		</dependency>
  </dependencies>
  <build>
    <finalName>DocStation</finalName>
    
     <plugins>
    	<plugin>
    		<groupId>org.springframework.boot</groupId>
    		<artifactId>spring-boot-maven-plugin</artifactId>
    	</plugin>
    	
    	<plugin>  
            <groupId>org.apache.maven.plugins</groupId>  
            <artifactId>maven-compiler-plugin</artifactId>  
            <configuration>  
                <source>${jdk.version}</source>  
                <target>${jdk.version}</target>  
            </configuration>  
        </plugin>  
    	
    </plugins>
  </build>
</project>




jstl引入:



<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

部分jar包:

两天了不知道怎么搞



加载中
0
wad12302
wad12302
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>

</dependency>

你少了jstl jar

jstl-1.2.jar

0
wangyunzhong
wangyunzhong
我不会springboot。但是从jar包上看,你引入了两个jstl包。
0
p2ng
p2ng
你引用Jetty的时候,不需要排除默认的Tomcat依赖吧。
0
咖啡男孩

这才是正解:jstl得使用jetty发布包里的jstl。

返回顶部
顶部