Reputation: 9
How does the conversion happen from xhtml to html ? whatever we coded in xhtml is displayed in HTML format when we view the page source in browser. How it happens. Is it because of < !DOCTYPE >. if so what is the role of DOCTYPE in conversion from xhtml to html
Upvotes: 0
Views: 1301
Reputation: 1157
The actual conversion is done by JSF framework. While executing the last phase "Render Response" each component in jsf will have a respective java render class while will parse the component into plain html which you are able to see in page view source.
Upvotes: 1
Reputation: 11787
The Doctype is a declaration which tells the browser what is the type of HTML code in the page. That has nothing to do with JSF and with any conversion from xhtml to html.
What you call conversion is done by JSF. You have somewhere in your web.xml
the following configuration:
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
To simplify, the FacesServlet
interprets the XHTML code to produce the HTML file returned to the browser.
Upvotes: 3