Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7195227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:32:11+00:00 2026-05-28T20:32:11+00:00

After these questions: https://stackoverflow.com/questions/8589315/jsf2-dynamic-template Dynamic ui:include How can I retrieve an object on @WindowScoped?

  • 0

After these questions:

  • https://stackoverflow.com/questions/8589315/jsf2-dynamic-template
  • Dynamic ui:include
  • How can I retrieve an object on @WindowScoped?
  • How can I check if an object stored with @WindowScoped is stored correctly?
  • ICE Faces and error in creation of a bean in WindowScoped

that I wrote all to resolve a “stupid” issue for the JSF2 framework, the fact that I can’t link directly to a page stored in a /WEB-INF subfolder. After that I did some research on Google and Stackoverflow I would know a thing: How do I structure a JSF2 web project?

In particular, where exactly do I put the XHTML pages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:32:12+00:00Added an answer on May 28, 2026 at 8:32 pm

    Files in /WEB-INF folder are indeed not publicly accessible by enduser. So you cannot have something like http://localhost:8080/contextname/WEB-INF/some.xhtml. That would be a potential security hole as the enduser would be able to view among others /WEB-INF/web.xml and so on.

    You can however use the /WEB-INF folder to put master template files, include files and tag files in. For example, the following template client page.xhtml which is placed outside /WEB-INF and is accessible by http://localhost:8080/contextname/page.xhtml:

    <ui:composition template="/WEB-INF/templates/template.xhtml"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
    >
        <ui:define name="content">
            ...
            <ui:include src="/WEB-INF/includes/include.xhtml" />
            ...
        </ui:define>
    </ui:composition>
    

    The advantage of placing master templates and include files in /WEB-INF is that the enduser won’t be able to open them directly by entering/guessing its URL in the browser addres bar. The normal pages and template clients which are intented to be accessed directly must not be placed in /WEB-INF folder.

    By the way, the composite component files are in turn also not supposed to be publicly accessible, however they are by specification required to be placed in /resources folder which is by default publicly accesible. If you make sure that you access all resources using the therefor provided components so that they are never accessed by /resources in URL (but instead by /javax.faces.resource), then you can add the following constraint to web.xml to block all public access to the /resources folder:

    <security-constraint>
        <display-name>Restrict direct access to the /resources folder.</display-name>
        <web-resource-collection>
            <web-resource-name>The /resources folder.</web-resource-name>
            <url-pattern>/resources/*</url-pattern>
        </web-resource-collection>
        <auth-constraint />
    </security-constraint> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Duplicate: https://stackoverflow.com/questions/587676/why-do-programs-in-unix-like-environments-have-numbers-after-their-name/ For instance, if I type: man ps ...and then scroll to the
I am seeing a similar issue as mentioned in this question - https://stackoverflow.com/questions/1495390/how-do-i-invalidate-a-session-in-jsf .
After my previous question (http://stackoverflow.com/questions/8217522/best-way-to-search-for-partial-words-in-large-mysql-dataset), I've chosen Sphinx as the search engine above my
I need to profile ruby gems memory usage. https://stackoverflow.com/a/164206/391229 suggests using system call to
Just like stackoverflow, there is a many-to-many relationship between Question and Tag. After running
After these instructions in the Python interpreter one gets a window with a plot:
After having looked at each of these two projects, it seems that both are
After staring at this 3D cube and these triangles for a while I started
After seeing many questions about how jQuery.load() handles tags in the content to be
Im after a plugin to do autocomplete like facebook does in that you can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.