代码之家  ›  专栏  ›  技术社区  ›  MrSir

带tomcat问题的Intellij Jsf启动网页

  •  0
  • MrSir  · 技术社区  · 7 年前

    在intellij 2017.2.6中,如果我创建了一个以Glassfish作为服务器的web项目,那么打开启动页面不会有任何问题 index.xhtml 页面,但当我用Tomcat创建相同的页面时,我有一个404。由于我对使用Intellij进行jsf开发还不熟悉,所以我想在这方面得到一些帮助。这就是我创建项目的方式。 enter image description here 这与我创建Glassfish的方式相同,只是没有选中webServices(即使我选中它,我也会遇到同样的问题)。当tomcat启动时,它会打开页面 http://localhost:8080/index.xhtml 正如配置中声明的那样。

    这是网络。xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
    </web-app>
    

    人工制品 enter image description here

    1 回复  |  直到 7 年前
        1
  •  1
  •   Jorge L. Morla    7 年前

    a busy cat

    检查库是否不在War/WEB-INF/libs中,如果不在,则添加。