• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Help with Simple Java EE Facelets Composite Application  RSS feed

Ranch Hand
Posts: 34
Android Chrome Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Ranchers,

I am trying to stay awake following the tutorial/documentation located here: https://javaee.github.io/tutorial/jsf-facelets005.html

I created the Web project for this in NetBeans IDE 8.2. My directory structure can be seen here: https://imgur.com/a/w42P6

The directory structure for the web application is as follows:

   - Web Pages
      - WEB-INF
      - resources
      .    |
      . - emcomp
      .     |- email.xhtml
      .     |- emuserpage.xhtml
      . index.xhtml
      - Source Packages
      - Libraries
      - Configuration Files    

The source code for the email.xhtml file is as follows:

The source code for emuserpage.xhtml is as follows:

There is also a default index.xhtml page that NetBeans creates. The code for this is as follows:

The index.xhtml page is the only thing that shows when deploying this application to glassfish.

If I enter the URL suggested in the tutorial: http://localhost:8080/application-name/emuserpage.xhtml I receive a 404 error.
When I go to http://localhost:8080/FaceletsCompositeExample/ I see the index.xhtml page.

The web.xml, deployment descriptor, for this project is as follows:

Is there a problem with the <servlet-mapping> section of the deployment descriptor? From my understanding the current mapping says to display things that are in the "faces" directory or something. I am not sure how the index.xhtml file is in the "faces" directory because in the project structure this file is under "Web Pages". Maybe the <welcome-file>faces/index.html</welcome-file> creates some imaginary (looking for a better word) directory structure and this is why the index.xhtml page shows up?

Does anyone know where I went wrong with this example?

Thank-you for reading this.


Kim Gordon

[Thumbnail for FaceletsCompositeExample-1-3-2018-11-59-02-AM.png]
Screenshot of FaceletsCompositeExample Project
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!