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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:13:02+00:00 2026-05-26T01:13:02+00:00

I have a problem with my composite component in JSF2. I implement a list

  • 0

I have a problem with my composite component in JSF2. I implement a list using ui and li. But if I use my component nothing happens. My list-tag is not replaced in code generated by facelet. So whats wrong with this.

The composite component is stored under /resources/util/list.xhtml. Here is the code:

<!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:composite="http://java.sun.com/jsf/composite"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<head><title>(For validation only)</title></head>
<body>
<composite:interface>
    <composite:attribute name="values"/>
    <composite:attribute name="listStyle"/>
    <composite:attribute name="elementStyle"/>
</composite:interface>
<composite:implementation>
<ul class="#{cc.attrs.listStyle}">
<ui:repeat var="element" value="#{cc.attrs.values}">
    <li class="#{cc.attrs.elementStyle}">#{element}</li>
</ui:repeat>
</ul>
</composite:implementation>
</body></html>

I use my tag this way

<!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:ui="http://java.sun.com/jsf/facelets"
    xmlns:core="http://java.sun.com/jsf/core"
    xmlns:utils="http://http://java.sun.com/jsf/composite/utils">
  <h:head>
    <title>Show user Color</title>
    <style type="text/css">
      .elements { font-style: italic; }
      .list { margin: 0px; padding:0px;}
    </style>

  </h:head>
  <h:body>
    <h1>Show Color</h1>
    <p>User selected: #{ColorBean.selectedColor}</p>
    <p>User set hex: #{ColorBean.showHex == true? "yes": "no"}</p>
    <p><h:outputFormat value="#{msgs.hexNotification}"
                    rendered="#{ColorBean.showHex}">
         <core:param value='#{ColorBean.showHex == true? "yes": "no"}' />
       </h:outputFormat>
    </p>
    <fieldset><legend>Colors</legend>
      <utils:list values="#{ColorBean.colors}" listStyle="list" elementStyle="elements"/>
    </fieldset>
  </h:body>
</html>

Here is the generated code.

<!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:utils="http://http://java.sun.com/jsf/composite/utils"><head>
    <title>Show user Color</title>
    <style type="text/css">
      .elements { font-style: italic; }
      .list { margin: 0px; padding:0px;}
    </style></head><body>
    <h1>Show Color</h1>
    <p>User selected: green</p>
    <p>User set hex: no</p>

    <p>
    </p>
    <fieldset><legend>Colors</legend>
      <utils:list values="[Ljava.lang.String;@13e86ec" listStyle="list" elementStyle="elements"></utils:list>
    </fieldset><div id="javax_faces_developmentstage_messages"></div></body>
</html>

What is wrong here. I use an tutorial to build this code.
http://courses.coreservlets.com/Course-Materials/pdf/jsf/jsf2/JSF2-Looping.pdf
They did a similar example on the last pages.

I hope you can help me

Thanks

  • 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-26T01:13:03+00:00Added an answer on May 26, 2026 at 1:13 am

    Change your

    xmlns:utils=”http://http://java.sun.com/jsf/composite/utils”>

    to

    xmlns:utils=”http://java.sun.com/jsf/composite/utils”>

    Regs,
    Rob

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

Sidebar

Related Questions

I have an array list that could contain component or composite and each component
Problem I have a one time use object which is a composite of several
Propose to consider the following problem. Suppose we have some composite object. Are there
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
This code, a test case for a custom component using JSF2 Just for the
I'm trying to create a composite component for use in my Seam application, and
I have a simple JSF 2.0 composite component example. <!DOCTYPE html PUBLIC -//W3C//DTD XHTML
I want to use simplified select one tag, which would generate select items list
I have a problem with setFocus(). Why it does not work on textBox? This
I have a composite control that is includes a groupbox control. The problem is

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.