For Tips to use specific Component Libraries see

Converting from JSP to facelets

  1. Backup everything
  2. Download and Install facelets
  3. For each .jsp file:
    1. rename file xxx.jsp to xxx.xhtml b. 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">

<f:view>

becomes

<f:view
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets">

or

<html>

becomes

<html
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets">

<%@ 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. above

<% /* my comment */ %>

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.

<ui:remove>my comment</ui:remove>

&nbsp;

becomes

&#160;
  1. change xml special characters in javascript and el expressions, & becomes &, < becomes < j. if you have any other conversion steps, please add them here.

This should get you to the point where your application works as facelets. From there, you can start using the facelets features.

MigrateFromJspToFacelets (last edited 2009-09-20 23:00:56 by localhost)