File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes XHTML in JSF1.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "XHTML in JSF1.2" Watch "XHTML in JSF1.2" New topic


Jayakrishnan.C Chandramohan

Joined: Aug 08, 2012
Posts: 11
Hi please help me. am new to java, can you please help me how to create welcome page in xhtml in jsf1.2.
i created, but when i wish to run the page it asks to save a file with unknown format
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

Welcome to the JavaRanch, Jayakrishnan!

There's a little bit of confusion with "xhtml". Traditionally, xhtml is strict-form XML HTML as defined by the W3C. However, a View Definition Language - also known as View Template Language - was created as part of the Facelets project, and the VDL files are also in XML format and carry the ".xhtml" file extension, even though they are not, strictly speaking XHTML.

If you want to output XHTML, that's just a matter of coding your view template properly. To the best of my knowledge, JSF's HTML renderers all create HTML that conforms to the XHTML standard.

On the other hand, if what you really want is to define views using VDL, your webapp must include the facelets jar available from the Facelets project, and you must configure Facelets in your web.xml.

Facelets has proven to be very useful. So useful, in fact, that VTL is the standard for defining Views in JSF2, Facelets support is built in to the JSF2 standard, and JSP Views are deprecated.

An IDE is no substitute for an Intelligent Developer.
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218

In fact, if you're just getting started do you have a pressing reason for using JSF 1.2 such as an employer
requirement? If not it would save you a fair amount of messing about by just using JSF 2. Another benefit
is that you can use a Java EE 6 server.

I agree. Here's the link:
subject: XHTML in JSF1.2
It's not a secret anymore!