Openshift 项目在本地运行但不在服务器上
Openshift project runs locally but not on the server
我首先创建了一个 Maven 项目,然后为 JSF 添加了 idex.xhtml 文件并将 web.xml 更改为
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" 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">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<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>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
之后删除了 JSP 和 html 类,我不需要它。因此,当我尝试在本地 运行 它时,我得到了索引页面,但是当我在网络上 运行 它时,我得到 http 状态 404 未找到。我提交并推动了我的更改,并在推动之前进行了干净的构建。有什么想法吗?
尝试检查您的日志以查看问题发生的位置。
最好的方法是通过 ssh 连接到设备并查看 ~/{cart_type}/logs
中的日志
我首先创建了一个 Maven 项目,然后为 JSF 添加了 idex.xhtml 文件并将 web.xml 更改为
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" 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">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<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>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
之后删除了 JSP 和 html 类,我不需要它。因此,当我尝试在本地 运行 它时,我得到了索引页面,但是当我在网络上 运行 它时,我得到 http 状态 404 未找到。我提交并推动了我的更改,并在推动之前进行了干净的构建。有什么想法吗?
尝试检查您的日志以查看问题发生的位置。
最好的方法是通过 ssh 连接到设备并查看 ~/{cart_type}/logs
中的日志