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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:19:06+00:00 2026-06-08T05:19:06+00:00

Background / Problem I’m trying to create a reusable JSF composite component that can

  • 0

Background / Problem

I’m trying to create a reusable JSF composite component that can be shared between many applications by packaging the components in jars (similar to Deploy JSF composite components for shared use and JSF 2.0 composite component into jar).

When trying to refer to these components in a facelets page of a web project in Eclipse, it doesn’t autocomplete (content assist) the tags or attributes of my composite component.

Using the same composite component jar in NetBeans works (autocompletion works!).

Quick summary

  • Eclipse (actually Rational Software Architect 8.0.4.1 – based on Eclipse Helios)

  • Web project with Dynamic web module and JSF facets enabled

  • Composite component jar on the build path

  • Composite component namespace declared in facelets page (interestingly it does autocomplete the namespace string of my component)

  • Only the standard JSF tags autocomplete (h:, f:, ui:, etc), as well as Primefaces (p:)

  • No autocompletion for my composite component 🙁

  • Autocompletion does work if I move the component to a web project and consume it from there (but then it’s no longer reusable in other projects!)

The details

Composite component jar structure

My composite component jar has the following structure when compiled (I’m actually using Maven, so the source structure is a little different).

composite-component.jar
|- META-INF/
|   |- beans.xml          (empty - just the beans tag)
|   |- faces-config.xml   (empty - just the faces-config tag/attributes)
|   \- resources
|       \- example
|           \- country.xhtml
\- com
     \- example
           |- Country.java
           |- CountryController.java  (the CDI managed bean)

Composite component definition

country.xhtml has the following contents

<?xml version='1.0' encoding='UTF-8' ?>
<!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:p="http://primefaces.org/ui"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:cc="http://java.sun.com/jsf/composite"
    xmlns:c="http://java.sun.com/jsp/jstl/core">

<!-- INTERFACE -->
<cc:interface>
    <cc:attribute name="value"
        shortDescription="A value expression for the selected value."
        required="true" />
</cc:interface>

<!-- IMPLEMENTATION -->
<cc:implementation>

    <p:autoComplete value="#{cc.attrs.value}"
        completeMethod="#{countryController.complete}" var="country"
        itemLabel="#{country.name}" itemValue="#{country.code}" dropdown="true"
        forceSelection="true">
    </p:autoComplete>

</cc:implementation>
</html>

Managed bean

My CDI managed bean has the following contents

package example;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;

@ApplicationScoped
@Named
public class CountryController {

    private static final List<Country> COUNTRIES = Arrays.asList(
        new Country("AUS", "Australia"), 
        new Country("FRA", "France"), 
        new Country("USA", "United States of America"));

    public List<Country> complete(String query) {
        List<Country> suggestions = new ArrayList<Country>();
        for (Country c : COUNTRIES) {
            if (c.getName().toLowerCase().contains(query.toLowerCase())) {
                suggestions.add(c);
            }
        }
        return suggestions;
    }
}

Consuming the composite component

If I create a JSF project in NetBeans and add my composite component (and Primefaces) to the build path, add the correct namespace to my facelets page (xmlns:x="http://java.sun.com/jsf/composite/example") it just works.

I get autocompletion on my component, it’s attributes, and it even uses the documentation from my component’s definition.

If I add the same composite component jar to the build path of my Eclipse web project (JSF facet enabled), I get nothing. It autocompletes for standard JSF tags and for Primefaces, but not for my component.

I’ve noticed that Primefaces uses a taglib file – is this what’s required for my scenario? I’d hate to have to duplicate the information to get autocompletion to work.

Edit:

As tasel has suggested, the best solution (so far) is to install JBoss Tools (specifically the RichFaces plugin). This enables autocompletion for composite components packaged in jar files (including inserting all mandatory attributes for you, and autocompleting all other attributes with hovering documentation).

I’d also recommend installing the JBoss Tools CDI plugin if you’re using CDI, as this gives you autocompletion for CDI managed beans and their properties/methods.

The Eclipse update site URLs are:

Helios:

http://download.jboss.org/jbosstools/updates/stable/helios/

Indigo:

http://download.jboss.org/jbosstools/updates/stable/indigo/

I did have issues installing from the update site URL and ended up downloading the p2 repo from the update page and installing it locally, but apart from that I’m very happy to have autocompletion working in Eclipse!

  • 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-06-08T05:19:09+00:00Added an answer on June 8, 2026 at 5:19 am

    Unfortunately support for JSF in Eclipse is not as comfortable as in NetBeans.
    I prefer to use the RichFaces Tools plugin from jBoss (which works perfectly without RichFaces and with any container). You might give it a try.

    Better support for JSF is considered to be available with the current eclipse release ‘Juno’ though I have not tried it yet.

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

Sidebar

Related Questions

The background to this problem is that I'm doing a computing project which involves
Problem background: I have a Qt/QML Symbian application targeting Qt 4.7.4, that requires a
The Problem: Background Information I'm writing an application for a client that is to
Possible Duplicate: Can we solve the table row background image problem, in chrome, in
Ok, background to the problem: I'm writing a little application that looks at the
Problem Background I am currently working on a camel based ETL application that processes
First, some background to my problem. There are many versions of Internet Explorer 6
First of all a little background of my problem, i'm trying to identify how
Problem background I am currently developing a framework of Ant Colony System algorithms. I
Problem background I have a post-commit script for my SVN repository which archives &

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.