1

I created a dynamic web project in Eclipse and added the JSF jars manually to the lib (instead using maven). I provided faces servlet configuration in web.xml.

I am trying to see the hello.xhtml output of the file placed webinf folder. But it is throwing:

/hello.xhtml Not Found in ExternalContext as a Resource.

My directory structure is as,

LibraryPro
  Java resoures
    Webcontent
      WEB-INF
         lib
         application.xml
      hello.xhtml 

the URL I am using is,

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_3_0.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" version="3.0">

  <display-name>JavaServerFaces</display-name>

  <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
  </context-param>

  <!-- Welcome page -->
  <welcome-file-list>
    <welcome-file>hello.xhtml</welcome-file>
  </welcome-file-list>

  <!-- JSF mapping -->
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <!-- Map these files with JSF -->
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>

</web-app>
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
droidsites
  • 1,035
  • 4
  • 16
  • 29
  • how did you accessed it ? hello.jsf ?show your web.xml Faces Servlet ..... code – Daniel Mar 29 '12 at 11:50
  • Your question seems unfinished and contradictory. You said *"I am trying to see the hello.xhtml output of the file placed webinf folder."* but the `hello.xhtml` is according to your directory structure ASCII art not in `WEB-INF` folder at all (which is correct!) – BalusC Mar 29 '12 at 12:25
  • @Daniel - I've updated my question with web.xml. Actually I posted the question in hurry – droidsites Mar 29 '12 at 12:27
  • @BalusC - I posted the question in hurry... sorry.. I updated the question – droidsites Mar 29 '12 at 12:28
  • try access your file like this /faces/hello.xhtml – Daniel Mar 29 '12 at 12:30
  • @Daniel --- Hmmm. Lol...Lol. Sometimes irritation makes Idiot... :-) I did few file placing mistakes in directory structure and got errors... after all got this error .... n simply posted it in SO. Sorry for this.... and Thanks Daniel – droidsites Mar 29 '12 at 12:39
  • I am facing similar problem.. Can any body help? – Bosco Aug 24 '12 at 05:47
  • @droidsites , your question has some problems: **1.** the URL is not specified **2.** Probably you should write `WebContent` instead of `webinf ` **3.** Use `WebContent` instead of `Webcontent` in the directory structure. – ROMANIA_engineer Jan 05 '16 at 08:58

0 Answers0