小编Ros*_*McC的帖子

Jetty 9绝对uri:http://java.sun.com/jsp/jstl/core无法解析

我正在使用

  • Jetty 9嵌入式.
  • Maven的
  • Java 1.7
  • JSTL

当我在Eclipse中运行我的应用程序并浏览到包含JSTL标记的网页时,它可以正常工作.当我将它捆绑在一个可执行的jar中并从cmd提示符运行时,我得到了

org.apache.jasper.JasperException:/jsp/pcReport.jsp(4,62)PWC6188:绝对的uri:http://java.sun.com/jsp/jstl/core无法在web.xml或者使用此应用程序部署的jar文件

我的依赖

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

    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>9.0.6.v20130930</version>
    </dependency>
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jsp-2.1-glassfish</artifactId>
        <version>2.1.v20100127</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

我的插件

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <archive>
                    <manifest>
                        <mainClass>com.pricemon.server.Main</mainClass>
                        <classpathPrefix>webapp/WEB-INF/lib/</classpathPrefix>
                        <addClasspath>true</addClasspath>
                    </manifest>
                    <manifestEntries>
                        <Class-Path>etc/</Class-Path>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <descriptors>
                    <descriptor>assembly.xml</descriptor>
                </descriptors>
            </configuration>
            <executions>
                <execution>
                    <id>make-assembly</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
Run Code Online (Sandbox Code Playgroud)

web.xml中

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">

    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup> …
Run Code Online (Sandbox Code Playgroud)

java jstl embedded-jetty maven

5
推荐指数
2
解决办法
4777
查看次数

标签 统计

embedded-jetty ×1

java ×1

jstl ×1

maven ×1