Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/384.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 Tomcat web.xml到GlassFish 4 web.xml_Java_Tomcat_Glassfish_Tomcat8_Glassfish 4.1 - Fatal编程技术网

Java Tomcat web.xml到GlassFish 4 web.xml

Java Tomcat web.xml到GlassFish 4 web.xml,java,tomcat,glassfish,tomcat8,glassfish-4.1,Java,Tomcat,Glassfish,Tomcat8,Glassfish 4.1,我有一个关于Tomcat8的项目。我想在GlassFish 4服务器上运行这个项目。我需要做什么? 如何更改web.xml以在GlassFish上运行项目? 或者问题不仅仅是web.xml,我还需要做什么 这是我的web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.s

我有一个关于Tomcat8的项目。我想在GlassFish 4服务器上运行这个项目。我需要做什么? 如何更改web.xml以在GlassFish上运行项目? 或者问题不仅仅是web.xml,我还需要做什么

这是我的web.xml

    <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <display-name>phonebook</display-name>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
  </context-param>

  <servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>

  <welcome-file-list>
    <welcome-file>/WEB-INF/views/index.jsp</welcome-file>
  </welcome-file-list>

  <filter>
    <filter-name>characterEncodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>

    <init-param>
        <param-name>encoding</param-name>
        <param-value>UTF-8</param-value>
    </init-param>

    <init-param>
        <param-name>forceEncoding</param-name>
        <param-value>true</param-value>
    </init-param>

</filter>
</web-app>

电话簿
上下文配置位置
/WEB-INF/dispatcher-servlet.xml
调度员
org.springframework.web.servlet.DispatcherServlet
2.
调度员
/
/WEB-INF/views/index.jsp
字符编码滤波器
org.springframework.web.filter.CharacterEncodingFilter
编码
UTF-8
强制编码
真的

您是否尝试过在GlassFish上运行Web应用程序?有什么问题吗?请详细说明。是的,我尝试运行我的web应用程序,但收到404错误。但在Eclipse中自动创建的新“HelloWorld”项目正在正常启动。