Tomcat在转换为maven后没有找到项目的欢迎页面

时间:2017-03-08 10:25:47

标签: java maven tomcat

长话短说,我们拥有所有库和其他好东西的服务器都被病毒感染了,所以我们决定尝试使用maven作为处理所有依赖关系的方法,所以我用它来测试它项目我正在努力。

该项目是一个myfaces + primefaces web应用程序,在将所有内容放在一起并获得pom.xml后,我给了它一个镜头,将它部署在我的tomcat上,当它试图加载欢迎时我得到了404页。我认为我的项目结构是正确的,但是在移动东西以使其符合maven的同时我搞砸了一些东西,我和周围的任何人都不会看到错误(也就是他们帮助cba)。

这是项目的web.xml的内容(欢迎页面在最后):

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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_3_0.xsd">
<display-name>Servlet 3.0 Web Application</display-name>
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Production</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.VALIDATE_EMPTY_FIELDS</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>primefaces.SUBMIT</param-name>
        <param-value>partial</param-value>
    </context-param>
    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>gp</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.CLIENT_WINDOW_MODE</param-name>
        <param-value>url</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.CACHE_EL_EXPRESSIONS</param-name>
        <param-value>noCache</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
        <param-value>0</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.STRICT_JSF_2_FACELETS_COMPATIBILITY</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.EARLY_FLUSH_ENABLED</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION</param-name>
        <param-value>0</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
        <param-value>100</param-value>
    </context-param>
    <!--    <context-param>
        <param-name>primefaces.PUSH_SERVER_URL</param-name>
        <param-value>http://localhost:8080</param-value>
    </context-param>-->
    <context-param>
        <param-name>carpetas.FUENTES</param-name>
        <param-value>/usr/share/fonts</param-value>
    </context-param>
    <context-param>
        <param-name>carpetas.FUENTES_TRUETYPE</param-name>
        <param-value>/usr/share/fonts/msttcore</param-value>
    </context-param>
    <context-param>
        <param-name>carpetas.TEMP</param-name>
        <param-value>/usr/local/tomcat/apache-tomcat-7.0.69/temp</param-value>
    </context-param>
    <context-param>
        <param-name>activeDirectory.ldap.nombreServidor</param-name>
        <param-value>atlante</param-value>
    </context-param>
    <context-param>
        <param-name>activeDirectory.ldap.nombreDominio</param-name>
        <param-value>intranet.com</param-value>
    </context-param>
    <context-param>
        <param-name>primefaces.UPLOADER</param-name>
        <param-value>auto</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
    </context-param>
    <listener>
        <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
    </listener>
    <filter>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <filter-class>
            org.primefaces.webapp.filter.FileUploadFilter
        </filter-class>
    </filter>
    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <filter>
        <filter-name>forceUTF8CharSet</filter-name>
        <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>forceUTF8CharSet</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <!--    <servlet>
        <servlet-name>Push Servlet</servlet-name>
        <servlet-class>org.primefaces.push.PushServlet</servlet-class>
        <async-supported>true</async-supported>
    </servlet>-->
    <!--    <servlet-mapping>
        <servlet-name>Push Servlet</servlet-name>
        <url-pattern>/primepush/*</url-pattern>
    </servlet-mapping>-->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <resource-env-ref>
        <resource-env-ref-name>BeanManager</resource-env-ref-name>
        <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
    </resource-env-ref>
    <session-config>
        <session-timeout>180</session-timeout>
        <tracking-mode>COOKIE</tracking-mode>
    </session-config>
    <welcome-file-list>
        <welcome-file>inicio.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

这是网络内容的项目结构

enter image description here

如果你们需要任何其他信息请求它,我会将其添加到问题中,提前谢谢。

1 个答案:

答案 0 :(得分:0)

如果应用程序未编译或已编译但未正确部署到Tomcat,则表示404是正常的。