Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/346.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Jetty-servlet调用给出目录索引没有任何明显的原因_Java_Servlets_Jetty - Fatal编程技术网

Java Jetty-servlet调用给出目录索引没有任何明显的原因

Java Jetty-servlet调用给出目录索引没有任何明显的原因,java,servlets,jetty,Java,Servlets,Jetty,杰蒂正在做一些奇怪的事情。它基本上向我展示了一个servlet的目录索引。一个具有几乎相同的web.xml和上下文xml的应用程序运行良好。这里是my web.xml: <?xml version="1.0" encoding="utf-16"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-i

杰蒂正在做一些奇怪的事情。它基本上向我展示了一个servlet的目录索引。一个具有几乎相同的web.xml和上下文xml的应用程序运行良好。这里是my web.xml:

<?xml version="1.0" encoding="utf-16"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <servlet>
        <servlet-name>Coflight</servlet-name>
        <servlet-class>org.codeliners.coflight.Coflight</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Coflight</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>


解决方法:我不知道为什么,但第十次重启Jetty后,不知何故修复了它

您正在调用哪个url?哪个版本的jetty?一些建议。升级Jetty,您使用的是Jetty 6(或更早版本),它们都是生命周期结束的产品。另外,不要在web.xml上使用UTF-16,坚持使用UTF-8、US-ASCII或ISO-8859-1以符合servlet规范。最后,如果从发行版提供的Jetty捆绑包在unix上运行Jetty,请注意还有其他进程监视日志,
/tmp
dir,装载空间,和运行中的服务器的PID,通常可以通过做一些对您不利的事情来“帮助”您。
<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
    <Set name="contextPath">/coflight</Set>
    <Set name="war">/mnt/K/coding/JCoflight/out/artifacts/JCoflight_war/Coflight.war</Set>
</Configure>
\ WEB-INF
  + classes
  | \ org
  |   \ codeliners
  |     ... (you get the point)
  \ web.xml