JSF and Facelets

Posted by Andrea Nasato Tue, 22 Nov 2005 10:42:00 GMT

One of the main issues with JSF is the plenty of use of custom tags in the view. If you don’t want to use a visual instrument like Java Studio Creator, building a page could become a nightmare, especially if your graphic designer uses a huge amount of html components.

If you ever tried Tapestry you know that with that framework this is not a problem, when you have the html template you have only to put the proper attribute to dynamically rendered tags and it’s all done.

Now also JSF allows you to do that: the project facelets aims to have the same approach used when developing with Tapestry. With facelets you can use templating and write a plain html file as a view.

Facelets is registered in the JSF framework as a ViewHandler, so the only things you have to do to start using facelest are

  • make JSF use facelets as ViewHandler: put those lines in the faces-config.xml
<faces-config>
  <application>
    <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
  </application>
</faces-config>
  • import libraries: you have to put in your classpath the facelets implementation jar (jsf-facelets.jar) that you can find in the facelets’ site.
  • modify the DEFAULT_SUFFIX param: facelets pages are simple xhtml files. JSF by default uses jsp files as view, so you have to tell the framework that now the views are the xhtml files. To do this you simply modify your web.xml in this way:
<context-param>
  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
  <param-value>.xhtml</param-value>
</context-param>

If you don’t want to become crazy with html stuff (your graphic designer is paid enough for this, isn’t it?) and you want to use JSF, try out facelets. If you want to learn more about facelets here you can find an introductive article and here you’ve got the reference documentation.

Posted in  | Tags ,  | 29 comments

Comments

  1. Avatar nitha said 1001 days later:

    i try to make an facelets application that using database, but it doesn’t clear yet. I use mySql 5.0 database. Can you help me?I’m a beginer=).

  2. Avatar New Jordans said 1989 days later:

    We’re able to in no way learn how to end up being daring as well as individual, in the event that there have been just pleasure on the planet. We might have discovered relief from the majority of evils; however we now have discovered absolutely no fix for the actual most detrimental of these just about all, the actual apathy associated with people. Such a sightless individual requirements isn’t the instructor however an additional personal. Exactly what I’m searching for isn’t available, it’s within me personally. What we should possess as soon as loved we are able to in no way shed. Everything all of us adore seriously gets part of all of us. Whenever we perform the very best that people may, all of us in no way understand what wonder is actually wrought within our existence, or even within the existence associated with an additional. Whilst these were stating amongst on their own this can’t be carried out, it had been carried out. New Jordans

  3. Avatar nike air force ones said 1990 days later:

    Give thought to the U.S. nike air force ones ultimate intent – defending our national interests by warfare. Just about every member, like the noncombatant, is devoted to that intent.

  4. Avatar GHD Straigheners said 1994 days later:

    If you need to explanation with regards to religion, and give a new reasoned (and reason-responsive) safeguard involving religion just as one further class of notion worth particular concern, I am just needing to participate in. My spouse and i surely scholarhip your lifetime in the happening involving religion; precisely what I would like to discover is often a reasoned terrain when deciding to take religion really in order to get on the simple fact, but not, declare, only in order men and women convenience them selves along with the other (a suitable purpose i accomplish get seriously). Nevertheless you mustn’t count on us for you to get along with your current defence involving religion as being a route to simple fact in case in just about any place anyone entice abdominal muscles dispensation you happen to be purportedly looking to make a case for. When you entice religion while explanation features anyone reinforced right place, take into consideration no matter whether anyone really need to depart explanation while explanation can be in your favor.

  5. Avatar Nike Air Jordan Shoes 2011 said 2007 days later:

    Freethinkers can be triggered willing to implement ones own opinions while not bias and even while not fearing to find out problems that battle utilizing possess persuits, rights, and certain principles. It mentality is simply not normal, though planning designed for best thinking about; at which it will be gone, topic is without a doubt prone to grown to be even more serious rather than crappy.

  6. Avatar barefoot running shoes said 2008 days later:

    Thank you for your good website. if you are looking for cheap but also with great quality shoes, then our http://barefoot-runningshoes.com will be your best choose.

  7. Avatar how to save your marriage said 2009 days later:

    The supreme happiness of life is the conviction that we are loved .

  8. Avatar Ed Hardy Outlet said 2017 days later:

    Men at some point understands that they will be the master-gardener involving the heart, your representative involving the lifestyle. Men whom dares for you to squander an hour of your energy haven’t found out the significance involving lifestyle. Most lifestyle is surely an research. Greater findings anyone create better. The many art work involving existing is based on a fine interacting involving enabling get along with holding on. Just about any idiot could deal with an emergency – it can be day by day existing that will has on anyone out and about. Feel that lifestyle may be valued at existing plus your notion might help develop simple fact.

  9. Avatar Ed Hardy 2011 said 2025 days later:

    Concerning a super easy doctrine: Pack what on earth is clean. Clean what on earth is 100 %. Scrape when them itches. Everyone loves everyday living for the reason that just what exactly extra could there be. I actually continue to obtain day after day very shorter for your opinions I want to assume, many of the strolling I want to bring, many of the courses I want to learn, plus many of the associates I want to find.

  10. Avatar Nike Lebron 8 said 2042 days later:

    Freethinkers are usually those who find themselves ready to utilize their particular heads with out prejudice and also with out fearing to know items that collide making use of their very own persuits, liberties, or perhaps thinking. This kind of mind-set just isn’t frequent, yet it is vital regarding proper pondering; in which it really is missing, debate will be more likely to grow to be a whole lot worse as compared to worthless.

  11. Avatar Cheap Nike Air Max said 2064 days later:

    That i usually do not get all main difference somewhere between Islam together with Islamic fundamentalists. I do think religion stands out as the cause, together with within the cause fundamentalism grows up as the lethal root. Whenever people do away with fundamentalism together with always keep religion, then one daytime or simply one other fundamentalism could improve for a second time. I must mention the fact that given that certain liberals at all times fight for Islam together with blame fundamentalists meant for designing concerns. However , Islam again oppresses most women. Islam again is not going to make it easy for democracy and this violates our the law.

  12. Avatar Jordan Shoes 2011 said 2065 days later:

    Don’t part with your illusions. When they are gone you may still exist, but you have ceased to live.

  13. Avatar Wholesale gadgets said 2210 days later:

    Thanks for the heads up on this subject. You know so much about this subject. So much so that you made me want to learn more about it. Your blog is my stepping stone, my friend.

  14. Avatar buy soundcloud plays said 3219 days later:

    Exactly the I really appreciate your post. It gives an outstanding idea that is very helpful for all the people on the web. Thanks for sharing this information and I’ll love to read your next post tooinformation I needed, thanks!

  15. Avatar sasas said 3360 days later:

    asasasas

  16. Avatar asasa said 3360 days later:

    asasas

  17. Avatar essay writing jobs said 3360 days later:

    Present days many students are waiting for your blog services. Your blog provides essay writing jobs and content services and assignment services. This informative post is given good knowledge for students. Thanks for this share for us.

  18. Avatar http://topaussiewriters.com/top-australian-writers/ said 3439 days later:

    I have a lot of australian essay writers and they were written best essay writing books for my http://topaussiewriters.com/top-australian-writers/ website. These educational reviews are very interesting to learn best essay writing books and best online content writing services.

  19. Avatar woman shoes said 3472 days later:

    hese can be easily afforded by the medium salaried women. Now it is time for them, to break through economic barriers and live their dreams.hen you have to attend a lot of parties

  20. Avatar TechMania said 4647 days later:

    Thanks

  21. Avatar WhollyTricks said 4647 days later:

    TechTroth

  22. Avatar TechkyUniverse said 4647 days later:

    HappyWishesDays

  23. Avatar Vodafone Caller Tunes Number said 4649 days later:

    Vodafone Caller Tunes

  24. Avatar Vodafone Caller Tunes Number said 4649 days later:

    Vodafone Caller Tunes

  25. Avatar Birthday Wishes for Wife said 4649 days later:

    Jio Caller Tunes

  26. Avatar Jio Caller Tunes Number said 4649 days later:

    Jio Caller Tunes

  27. Avatar Jio Caller Tunes Number said 4649 days later:

    Birthday Wishes for Father

  28. Avatar Laptops Under 500 said 4649 days later:

    Laptops Under 400

  29. Avatar Laptops Under 500 said 4649 days later:

    Laptops Under 200

(leave url/email »)

   Comment Markup Help Preview comment