好吧,当我尝试以这种方式访问我的页面时:
http://XXX.XXX.XXX.XX:8080/Odontonew
我得到了错误:
type Status report
message /Odontonew/
description The requested resource (/Odontonew/) is not available.
但是,如果我尝试以这种方式访问:
http://XXX.XXX.XXX.XX:8080/Odontonew/index.jon
这工作正常。所以我确定我的问题出在 web.xml 但我不知道在哪里,请参阅下面我的 web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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_3_0.xsd"
id="WebApp_ID">
<display-name>Odontonew</display-name>
<!-- Configuracao do Spring -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<!-- Configuracao DO JSF -->
<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>*.jon</url-pattern>
</servlet-mapping>
<!-- Servlet para Direcionar imagens -->
<servlet>
<servlet-name>imageServlet</servlet-name>
<servlet-class>br.com.odontonew.util.ImageServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>imageServlet</servlet-name>
<url-pattern>/pictures/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jon</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>afterwork</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.writeStateAtFormEnd</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>pictureDirectory</param-name>
<param-value>${user.home}/webapp/Odontonew/pictures/</param-value>
</context-param>
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
<init-param>
<param-name>thresholdSize</param-name>
<param-value>51200</param-value>
</init-param>
<init-param>
<param-name>uploadDirectory</param-name>
<param-value>${user.home}/webapp/Odontonew/tmp/</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
</web-app>
在我的项目的根文件夹中,我有页面“index.xhtml”,但我想使用以下路径访问项目:http://XXX.XXX.XXX.XX:8080/Odontonew(没有 index.jon 或 index. html).