gpt4 book ai didi

java - Tomcat 转换为 maven 后找不到项目的欢迎页面

转载 作者:行者123 更新时间:2023-11-28 23:21:46 26 4
gpt4 key购买 nike

长话短说,我们拥有所有库和其他好东西的服务器被病毒感染了,所以我们决定尝试使用 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

如果你们需要任何其他信息,请提出要求,我会将其添加到问题中,在此先感谢。

最佳答案

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

关于java - Tomcat 转换为 maven 后找不到项目的欢迎页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42668732/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com