Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Apache Myfaces with Prime faces

I am new bie to JSF 2.0.

I am using the apache Myfaces implementation of JSF 2.0.

Also I want to use Prime faces for better UI components.

But the problem I am facing is:

The tags for both the Prime faces and Myfaces are same.

How do I resolves the prefixes.

For example: h: and f:

like image 686
Sunny Gupta Avatar asked Jul 20 '26 16:07

Sunny Gupta


2 Answers

PrimeFaces does not have any tags in the http://java.sun.com/jsf/* namespace. It has only tags in the http://primefaces.org/* namespace. Tags in the http://java.sun.com/jsf/* namespace are part of the concrete JSF implementation which is in your case MyFaces. PrimeFaces is just a component library, not a JSF implementation. You are supposed to run PrimeFaces on top of a concrete JSF implementation.

So, once having both MyFaces and PrimeFaces in the webapp's runtime classpath, this should do:

<!DOCTYPE html>
<html lang="en"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
>
    <h:head>
        <title>Title</title>
    </h:head>
    <h:body>
        <h1>PrimeFaces editor demo</h1>
        <p:editor />
    </h:body>
</html>
like image 82
BalusC Avatar answered Jul 23 '26 13:07

BalusC


Include primefaces by using the following xmlns:p="http://primefaces.org/ui"

like image 24
Michael Avatar answered Jul 23 '26 14:07

Michael