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 6694615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:07:21+00:00 2026-05-26T06:07:21+00:00

I have recently started working with JSF2.0 and Facelets, but have run into what

  • 0

I have recently started working with JSF2.0 and Facelets, but have run into what I hope is an easy answer for most of you out there. When I am trying to add any HTML tag within a <ui:define> tag I receive the following error:

javax.faces.view.facelets.TagException: /content/home/test.xhtml @11,10 Tag Library supports namespace: http://java.sun.com/jsf/facelets, but no tag was defined for name: div

If I remove all of the HTML tags from the section the page displays correctly. Here is my simple page that I have been trying to get working:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:jrc="http://com.comanche.web.components"> 
<ui:composition template="/templates/masterLayout.xhtml" xmlns="http://java.sun.com/jsf/facelets">      

    <ui:define name="windowTitle">Home</ui:define>
    <ui:define name="content">
            <div>I want to add HTML and am having lots of trouble.</div>
    </ui:define>
</ui:composition>
</html>

I know I should be able to add HTML within the define tag. What do I need to do to get HTML in without any errors.

  • 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-26T06:07:21+00:00Added an answer on May 26, 2026 at 6:07 am

    Your <ui:composition> declaration is using the wrong global XML namespace. You definied http://java.sun.com/jsf/facelets as global XML namespace while it should have been assigned to ui: XML namespace. The <div> tag doesn’t exist in the Facelets taglib (which is what the exception is trying to tell you). You should have assigned http://www.w3.org/1999/xhtml as global XML namespace. Further, the <!DOCTYPE> and <html> will be ignored anyway. The sole content of the file should be the following:

    <ui:composition template="/templates/masterLayout.xhtml" 
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets">      
    
        <ui:define name="windowTitle">Home</ui:define>
        <ui:define name="content">
            <div>I want to add HTML and am having lots of trouble.</div>
        </ui:define>
    </ui:composition>
    

    Nothing before or after <ui:composition> in the very same file is necessary.

    See also:

    • How to include another XHTML in XHTML using JSF 2.0 Facelets?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that I have recently started working on seriously but had
I've recently started working with multi-threaded Winform applications and have run up against a
I'm very used to working in WPF, but I have recently started building websites
I recently started working with CakePHP but there are a few things I don't
I have recently started working on a legacy application that has most of its
I have recently started working on a very large C++ project that, after completing
I have recently started working with Unified Communication Managed API 2.0 (UCMA) and Office
I have only recently started working with the MVC approach, so I suppose this
I have recently started using Vim as my text editor and am currently working
I have recently started looking into Google Charts API for possible use within the

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.