For Tips to use specific Component Libraries see
Converting from JSP to facelets
- Backup everything
- Download and Install facelets
https://facelets.dev.java.net - For each .jsp file:
- rename file xxx.jsp to xxx.xhtml
- insert the xhtml doctype tag at the very top
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- add namespaces to the root level xml element
becomes
<f:view>
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets">
or
becomes<html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets">
- remove jsp directives, change
to
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
after the other xmlns: attributes in 3.c. abovexmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
- add the xmlns: of any other jsf libs (tomahawk, tobago, htmlib, ...) to the end, after C.d above
- for each jsf lib you add, you must put the corresponding taglib.xml file under .../WEB-INF/
- convert other jsp tags, e.g.
becomes
<% /* my comment */ %>
Note that you will probably want to use the following instead of <!-- my comment --> as standard html comments are stripped by default and treated as literal text block components if re-enabled.<!-- my comment -->
<ui:remove>my comment</ui:remove>
- change all xml entities to numerical form, e.g.
becomes
 
- change xml special characters in javascript and el expressions, & becomes &, < becomes <
j. if you have any other conversion steps, please add them here.
- rename file xxx.jsp to xxx.xhtml
This should get you to the point where your application works as facelets. From there, you can start using the facelets features.