2011-10-04 389 views
0

我在我的应用程序的一个使用JSF和情况如下:请求的资源不可用

1.I有一个pages文件夹下WEB_INF

2.Inside pagesa.jsp

3.当我使用本地tomcat部署此应用程序时,它说“请求的资源(/pages/a.jsp)不可用。”

<?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/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> 
     <display-name>Sample_Proj</display-name> 
     <welcome-file-list> 
      <welcome-file>index.html</welcome-file> 
      <welcome-file>index.htm</welcome-file> 
      <welcome-file>AddUser.jsp</welcome-file> 
      <welcome-file>default.html</welcome-file> 
      <welcome-file>default.htm</welcome-file> 
      <welcome-file>default.jsp</welcome-file> 
     </welcome-file-list> 
    </web-app> 

还有什么我需要添加到web.xml? 下面的网址是我用什么打的页面: http://localhost:8080/Sample_Proj/WEB-INF/page/AddUser.jsp

回答

1

你的JSP文件/文件夹应该存在于Web项目的根,而不是在WEB-INF文件夹,即:

/pages/a.jsp
/WEB-INF/...

当涉及到JSF Web项目时,您的web.xml文件非常不完整。我会推荐阅读Java EE 6教程,您可以通过this chapter阅读有关Web应用程序入门的信息

相关问题