Intellij Jsf与tomcat问题启动网页 [英] Intellij Jsf with tomcat issue starting web page
问题描述
在intellij 2017.2.6中,如果我使用Glassfish作为服务器创建一个Web项目,打开起始 index.xhtml
页面时没有任何问题,但是当我创建和Tomcat一样,我有一个404.由于我是初次使用Intellij进行jsf开发,我想要一些帮助。这就是我创建项目的方式。
这与我创建Glassfish的方式相同,除非取消选择webServices(即使我检查它我也有同样的问题)。当tomcat启动时,它打开页面 http:// localhost:8080 / index.xhtml
,因为它在配置中声明。
In intellij 2017.2.6 if i create a web project with Glassfish as server i don't have any problems opening the starting index.xhtml
page, but when i create the same with Tomcat i have a 404. Since i'm new to jsf development with Intellij i wanted some help with this. This is how i create the project.
It's the same way i create a Glassfish, except with webServices deselected (even if i check it i have the same issues). When tomcat starts it opens the page http://localhost:8080/index.xhtml
as it's declared in the configuration.
这是web.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>
工件
推荐答案
检查这些库是否在War / WEB-INF / libs中,如果没有,则添加。
check if the libraries aren't in the War/WEB-INF/libs, if not, add then.
这篇关于Intellij Jsf与tomcat问题启动网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!