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 1068001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:13:49+00:00 2026-05-16T20:13:49+00:00

;Hi, I am using JSF 2.0 Mojarra ver. 2.0.2-SNAPSHOT (obtain using maven). I am

  • 0

;Hi,

I am using JSF 2.0 Mojarra ver. 2.0.2-SNAPSHOT (obtain using maven).

I am trying to use Annotation to setup JSF bean, as such:

@ManagedBean
@RequestScoped
public class HelloBean {
    @ManagedProperty(value="test")
    private String name;

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
}

The annotation does not work, meaning the HelloBean class is not configured as JSF bean. To illustrate this, i have the following page

<?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:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
<head>
    <title>Hello World</title>

</head>
<body>
<f:view>
    Hello #{helloBean.name}
</f:view>
</body>

</html>

The name “test” should be printed on the page. But when i run on Tomcat 6.20 and JDK 1.6, the name does not show.

If i use faces-config.xml to configure HelloBean, the name appears correctly on the page.

What have I missed?

  • 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-16T20:13:51+00:00Added an answer on May 16, 2026 at 8:13 pm

    If you have any faces-config.xml file, it needs to be declared as JSF 2.0, not as JSF 1.2 or lower.

    <faces-config
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
        version="2.0">
    

    By the way, the f:view is unnecessary in Facelets.

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

Sidebar

Related Questions

I am using JSF 2.0 Mojarra. I need to create a Managed Bean that
I'm using Tomahawk12-1.1.10 with Mojarra JSF 1.2_04 . When I try to use: <t:dataList
I'm trying to use Maven, Jetty and HtmlUnit to test a webapp written using
I'm trying to inject spring bean into JSF bean, I'm using Spring 3.1 and
I'm using JSF (Mojarra 1.2) with Richfaces (3.3.2) within some facelets which are used
I am writing a JSF 2.0 Mojarra application using Primefaces 3.3.1 on Tomcat 6.
I am using Mojarra 2.0.4 implementation of JSF with Tomcat server for one of
In my application I want to use JSF 2.1.14 Mojarra with Servlet 3.0 and
I'm using JBoss6.1.Final, JSF 2.0 (Mojarra), Weld CDI, MyFaces CODI 1.0.5 (for view-access-scoped) I'm
i have a problem with rendering #{} inside JSF page. I'm using Mojarra 2.1.5

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.