Maven 未找到Glassfish inteliji index.html
我有一个模块项目 应用程序-项目 模块: -生意 -刀 -模型 -网络应用 我试图在glassfish服务器上只卸载webapp(它是jsf项目),但每次尝试创建工件时,我都会遇到服务器错误404,找不到index.xhtml或HTTP状态404-/index.xhtml作为资源在ExternalContext中找不到 pom.xml(webapp模块)Maven 未找到Glassfish inteliji index.html,maven,jsf,intellij-idea,Maven,Jsf,Intellij Idea,我有一个模块项目 应用程序-项目 模块: -生意 -刀 -模型 -网络应用 我试图在glassfish服务器上只卸载webapp(它是jsf项目),但每次尝试创建工件时,我都会遇到服务器错误404,找不到index.xhtml或HTTP状态404-/index.xhtml作为资源在ExternalContext中找不到 pom.xml(webapp模块) 谢谢你的帮助 为什么你的index.xhtml最终会出现在classes文件夹中?那是用artifact创建inteliji的,我不知道为
谢谢你的帮助 为什么你的index.xhtml最终会出现在classes文件夹中?那是用artifact创建inteliji的,我不知道为什么我最终解决了它,我不确定为什么index.xhtml应该在src/main/webapp/中,但是web.xml保留在web/web-INF/标记为resources查看配置web应用项目资源的文档,这就是maven的工作方式。。。最好在使用工具时学习工具的基本知识。(在这方面,您错过了两个最重要的标记(java、glassfish和http-status-code-404,尽管它们被使用或是“错误”,但maven和inteliji的关联性更强)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>app</artifactId>
<groupId>com.mbucko.auctions</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>webapp</artifactId>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>web\WEB-INF\web.xml</webXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.faces/jsf-api -->
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.3</version>
</dependency>
</dependencies>
</project>
<?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"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>PrimeFaces Web Application</display-name>
<!-- Change to "Production" when you are ready to deploy -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- Welcome page -->
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<!-- JSF mapping -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map these files with JSF -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
</web-app>