2014-01-23 58 views
1

我运行我的项目时出现404错误,我的JBoss服务器运行正常。404错误index.html文件

这里是在index.html的:

<html> 
<body> 

<form action="/services/customers" method="post"> 
First Name: <input type="text" name="firstname"/><br/> 
Last Name: <input type="text" name="lastname"/><br/> 
<INPUT type="submit" value="Send"> 
</form> 

</body> 
</html> 

这里是web.xml文件:

<?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" 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" version="3.0"> 
<display-name>SIMS</display-name> 
<welcome-file-list> 
<welcome-file>index.html</welcome-file> 
</welcome-file-list> 
<servlet> 
<servlet-name>Resteasy</servlet-name> 
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> 
</servlet> 
<servlet-mapping> 
<servlet-name>Resteasy</servlet-name> 
<url-pattern>/*</url-pattern> 
</servlet-mapping> 
<context-param> 
<param-name>javax.wcs.rs.Application</param-name> 
<param-value>org.jboss.samples.webservices.MyRESTApplication</param-value> 
</context-param> 
<listener> 
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class> 
</listener> 
<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> 
</web-app> 

这里是我的文件结构:

enter image description here

当我运行这个项目时,我得到一个404错误

http://localhost:8080/SIMS/

我也试过:

http://localhost:8080/SIMS/index.html 

这也给了404如何获得该项目运行任何想法?

回答

2

您的文件,我认为这个问题是<url-pattern>。 jsf库无法找到您的页面。

试着改变你的<url-pattern><url-pattern>*.jsf</url-pattern>

然后重命名为<welcome-file>到index.jsf和明年创建一个空index.jsf文件的index.html。

1

尝试只在本地主机输入,并从浏览树

+0

所以我应该只有http:// localhost:8080 /并从其位置开始文件?对不起,只是不太确定你的意思 – Bawn

+0

是试试./我不知道,但你应该只能使用本地主机,我从来不打扰在我的端口打字。 – Martin42006