Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6722993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:30:54+00:00 2026-05-26T09:30:54+00:00

I am new to JSF so this is my first project. My IDE is

  • 0

I am new to JSF so this is my first project.
My IDE is netbeans 7.0.1, Mojarra 2.1.1 and primefaces 2.2.1

I used the tree example via http://www.primefaces.org/showcase/ui/tree.jsf
While I manage to use other faclets from prime (for example p:button)
the tree is not working for me(blank screen)
Can someone can please explained me what did I do wrong ?

Thanks

 <?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:p="http://primefaces.prime.com.tr/ui"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core">
<f:view contentType="text/html"> 
<h:head>
    <title>Facelet Title</title>
</h:head>
<h:body>
    <h:form>
        <p:tree value="#{treeBean.root}" var="node">
            <p:treeNode>
                <h:outputText value="#{node}" /> 
            </p:treeNode>
        </p:tree>
    </h:form>
</h:body>
</f:view>

 package org.primefaces.examples.view;

import javax.faces.bean.SessionScoped;
import org.primefaces.model.TreeNode;
import org.primefaces.model.DefaultTreeNode;


public class TreeBean {

private TreeNode root;

public TreeBean() {
    root = new DefaultTreeNode("Root", null);
    TreeNode node0 = new DefaultTreeNode("Node 0", root);
    TreeNode node1 = new DefaultTreeNode("Node 1", root);
    TreeNode node2 = new DefaultTreeNode("Node 2", root);

    TreeNode node00 = new DefaultTreeNode("Node 0.0", node0);
    TreeNode node01 = new DefaultTreeNode("Node 0.1", node0);

    TreeNode node10 = new DefaultTreeNode("Node 1.0", node1);
    TreeNode node11 = new DefaultTreeNode("Node 1.1", node1);

    TreeNode node000 = new DefaultTreeNode("Node 0.0.0", node00);
    TreeNode node001 = new DefaultTreeNode("Node 0.0.1", node00);
    TreeNode node010 = new DefaultTreeNode("Node 0.1.0", node01);

    TreeNode node100 = new DefaultTreeNode("Node 1.0.0", node10);
}

public TreeNode getRoot() {
    return root;
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:30:54+00:00Added an answer on May 26, 2026 at 9:30 am

    I think it’s because you don’t have @ManagedBean annotation in your TreeBean class

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying out my first richfaces project. So I created a new JSF
I am new to JSF, I am working on web project. I want to
hi im kind of new at jsf enviroment, im trying to update a primefaces
I'm at the end of my rope with this one. I'm new to JSF
I am new to JSF 2.0 and Primefaces but have decided to create my
I'm new in jsf and jpa technologies, and trying my first web application with
This is my first attempt at using JSCookMenu and its homepage ( http://jscook.yuanheng.org/JSCookMenu/ )
I am VERY new to JSF, and I need some help doing, what I
I am new to jsf. I have the bellow code. When I place ui:repeat
I am new to JSF and struggling with a problem. I am hoping that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.