tags:

views:

346

answers:

2

Is there any tool or plugin available to convert HTML code to JSF tags?

+1  A: 

Converting HTML Files to JSF

Hope this helps.

rahul
A: 

If you are using Facelets, you can add for any HTML tag the jsfc attribute that will indicate which JSF component is related to the HTML tag. For example:

<input id="bar" type="text" jsfc="h:inputText" value="#{foo.bar}"/>

I am not sure that automatically generate JSF code from HTML code is a good idea. JSF uses JSP or XHTML pages as a XML description of a page structure. The HTML code is automatically generated by the JSF framework. If you generate the JSF code from the HTML code, you will have a lot of garbage code in your JSP/XHTML files, and I am not sure that the generated code will work correctly.

It is quite dependent of the quality of the HTML you have in fact...

However, you may have a look at the phoenix solution and then clean the generated JSF code.

romaintaz