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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:01:42+00:00 2026-05-13T21:01:42+00:00

Facelets uses the jsfc attribute to convert HTML elements to their associated JSF components.

  • 0

Facelets uses the jsfc attribute to convert HTML elements to their associated JSF components. This is rather helpful for fast prototyping as it allows you to create your views using a visual design tool. However I recently discovered this blog post by Cay Horstmann where he lays waste to the use of jsfc together with complex components such as h:dataTable.

This alarmed me as Cay Horstmann is the author of multiple of my favorite Java books. However my Google-fu skills have yielded zero results when trying to determine the scope/nature of the problem, other than a recent post by Ed Burns, who seams to like jsfc (and he is after all the co-spec lead for JSF). So my question is simply, is it recommended to use jsfc with Facelets ? and if not what’s the problem it introduces.

  • 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-13T21:01:42+00:00Added an answer on May 13, 2026 at 9:01 pm

    As you said, the jsfc attribute is essentially usefull when you have to “convert” an HTML prototype to a JSF page. For example, when you have an HTML input text:

    <input type="text" .../>
    

    you can add the jsfc attribute in order to convert this HTML component into a JSF component:

    <input type="text" jsfc="h:inputText" .../>
    

    This is equivalent to writing the following JSF code:

    <h:inputText .../>
    

    As stated in the Facelets documentation here or here, the attribute jsfc can also be used to “map” Facelets components. For example, you can remove a part of the HTML code:

    <span jsfc="ui:remove">
    This won't be compiled either <h:outputText value="#{foo.bar}"/>
    </span>
    

    You can also create a table using this attribute:

    <table>
        <tr jsfc="ui:repeat" value="#{dept.employees}" var="emp" class="#{emp.manager ? 'mngr' : 'peon'}">
           <td>#{emp.lastName}</td>
           <td>#{emp.firstName}</td>
        </tr>
    </table>
    

    In this example, we do not link this table to a h:datatable component, but we create a table with HTML code, using the JSF component ui:repeat to iterate on rows.

    As you can see, the jsfc attribute can be used to convert one HTML component into one JSF component in a JSF page. So for complex components, such as the datatable, you will have to use some workarounds (using ui:repeat instead of the h:datatable component).

    Another point is that you will not be able to use third-libraries components such as the ones proposed by RichFaces, IceFaces, Tomahawk, and so on. And these libraries are really one of the interests of JSF.

    So to summarize: jsfc can be usefull to transform a HTML prototype into a JSF applications, essentially for creating Proof of Concepts or designing the general UI. However, I think it is better to avoid this component once the “real” development starts…

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

Sidebar

Ask A Question

Stats

  • Questions 381k
  • Answers 381k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The first rule of performance tuning is, "it depends." Compression… May 14, 2026 at 10:17 pm
  • Editorial Team
    Editorial Team added an answer Look into jquery attributes. You need something along the lines… May 14, 2026 at 10:17 pm
  • Editorial Team
    Editorial Team added an answer This is not the exact answer to the question. But… May 14, 2026 at 10:17 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.