Przemek Nowak
Przemek Nowak

Reputation: 7693

Using JSP 2.0 tags in Facelets

Is someone 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?

Upvotes: 2

Views: 3031

Answers (3)

Scott Jones
Scott Jones

Reputation: 51

<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's "http://java.sun.com/jsp/jstl/core" or it won't work.

Upvotes: 0

Bozho
Bozho

Reputation: 597016

Facelets and JSP are mutually exlusive - they are two different view technologies.

Some JSP tags are ported to facelets, using the facelets tag library descriptors.

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

Upvotes: 2

Allan Lykke Christensen
Allan Lykke Christensen

Reputation: 1347

In Facelet XHTML you would add a taglib in the following way:

<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">

Upvotes: 4

Related Questions