When I rename the name of a dynamic web project with JSF v2.2 as configuration created by itself Eclipse 2019.03 then I redeploy it on glassfish v5.1 with Eclipse, gets HTTP Status 404 - Not Found... While it was working well before renaming project name.
web.xml file:
<?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" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>test1</display-name>
<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>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
There is a simple index.xhtml in /WebContent
I noticed when a new dynamic web project with JSF as configuration has been created by itself Eclipse, if you use Glassfish as server, there will be an additional file named glassfish-web.xml in /WebContent/WEB-INFO directory.
When the name of a dynamic web project is renamed, the line below of glassfissh-web.xml file should be modified manually to new name of the project:
<context-root>/testProject</context-root>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments