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

  • Home
  • SEARCH
  • 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 6318949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:43:06+00:00 2026-05-24T15:43:06+00:00

I am continuing my practices with JSF 2.0. I see templating is a great

  • 0

I am continuing my practices with JSF 2.0.
I see templating is a great thing to do, and it has lots of advantages. But today i got a new doubt related to it.

I created a template for my pages.
In the template, i use tags for the parts that are different(Those parts will be implemented later in a page using the composition tag in combination one or more define tags).

<ui:insert name="content" />

Also inside the template, to avoid putting to much code in the template, i create tags to add some other chunks of xhtml.

<ui:include src="/languageChanger.xhtml"/>

This is how my folder structure looks:

enter image description here

It all works as i spect, but when in the url i navigate to languageChanger.xhtml i see the composite chunk of xhtml:

enter image description here

My doubts are:

-Is that chunk of independent code placed in the right place?, Or it is wrong, the user should not be allowed to see that from the URL?

-Is that place save to have other components like login, register…?

-To avoid user access directly the component i could place it in WEB-INF folder, but then i have a problem that the include tag does not find the path. What should i do?

-What would be the best practice, where to place this independent chunks of code?

  • 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-24T15:43:06+00:00Added an answer on May 24, 2026 at 3:43 pm

    Is that chunk of independent code placed in the right place?, Or it is wrong, the user should not be allowed to see that from the URL?

    Put it somewhere in /WEB-INF. Direct access to this folder is disallowed by the container.


    Is that place save to have other components like login, register…?

    I don’t understand you. Perhaps you meant to say “safe” instead of “save”? What do you mean with “other components”?


    To avoid user access directly the component i could place it in WEB-INF folder, but then i have a problem that the include tag does not find the path. What should i do?

    Your path was apparently plain wrong. Facelet templates, includes, tags and compositions (not composite components) can perfectly be placed in /WEB-INF.


    What would be the best practice, where to place this independent chunks of code?

    Put it in /WEB-INF. Best practice is to use absolute paths, i.e. start the path with /. It will be resolved relative to the webcontent root. E.g.

    <ui:include src="/WEB-INF/languageChanger.xhtml" />
    

    Only the “main” page (the one which is to be requested by URL) cannot be placed in /WEB-INF.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Continuing from my previous question , is there a comprehensive document that lists all
Continuing my problem from yesterday, the Silverlight datagrid I have from this issue is
Continuing my investigation of expressing F# ideas in C#, I wanted a pipe forward
Continuing on previous questions ( here , and here ), I implemented a basic
Continuing on my attempt to create a DateTime class , I am trying to
Continuing the discussion about the minimum footprint needed to connect to an Oracle DB
Continuing from this question : When I am trying to do fopen on Windows,
Continuing my quest of learning Java by doing a simple game, i stumbled upon
Due to continuing crash problems, I'm about to uninstall and reinstall my copy of
I know NTEXT is going away and that there are larger best-practices issues here

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.