jsf 2 - Render Primefaces component in JSF -



jsf 2 - Render Primefaces component in JSF -

jsf 2.2 + primefaces 5.0 + managed bean

i want simple thing:

i want render primefaces component in jsf site using managed bean.

jsf:

<?xml version='1.0' encoding='utf-8' ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head> <title>beantest</title> </h:head> <h:body> #{testbean.output} </h:body> </html>

the managed bean:

public class testbean { /** * creates new instance of testbean */ public testbean() { } private string output = "<p:calendar mode=\"inline\"/>"; /** * value of output * * @return value of output */ public string getoutput() { homecoming output; } /** * set value of output * * @param output new value of output */ public void setoutput(string output) { this.output = output; } }

the result text <p:calendar mode=\"inline\"/>.

how can primefaces component rendered?

if utilize regular way (the bean sets attributes of primefaces components), works fine.

jsf jsf-2 primefaces managed-bean

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -