Using JSP 2.0 Tags in Facelets

Anyone using Facelets with JSP 2.0 tags? How to add tag library to xhtml page? In JSP, I used:

<% taglib prefix="example" tagdir="/WEB-INF/tags/my" %> 
and : <example:sample/>

      

How can I do the same in facelets with JSP 2.0 tags?

+2


a source to share


3 answers


In Facelet XHTML, you add the taglib like this:



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

      

+4


a source


Facelets and JSP are mutually beneficial - they are two different viewing technologies.

Some JSP tags are carried over to facelets using the facelets tag library descriptors.



So, if you want to define facelets tags, add the appropriate descriptors.

+2


a source


<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

      

That "http://java.sun.com/ jsp / jstl / core" or it won't work.

0


a source







All Articles