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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:10:06+00:00 2026-06-10T20:10:06+00:00

I have a web application which uses JSF 2.0 mojjarra. i want to put

  • 0

I have a web application which uses JSF 2.0 mojjarra. i want to put my managed bean classes to a package named like this.

package com.myapp.managedbean

How can i tell the jsf to scan this package for annotated managed beans.

My maven dependencies

dependencies>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
</dependency>
 <dependency>
  <groupId>com.sun.faces</groupId>
  <artifactId>jsf-api</artifactId>
  <version>2.0.2</version>
</dependency>

<dependency>
  <groupId>com.sun.faces</groupId>
  <artifactId>jsf-impl</artifactId>
  <version>2.0.2</version>
</dependency>

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>jstl</artifactId>
  <version>1.2</version>
</dependency>

<dependency>  
    <groupId>org.primefaces</groupId>  
    <artifactId>primefaces</artifactId>  
    <version>3.4</version>  
</dependency>

<dependency>  
    <groupId>org.apache.tomcat</groupId>  
    <artifactId>tomcat-servlet-api</artifactId>  
    <version>7.0.26</version>  
    <scope>provided</scope>  
  </dependency>  

My managed bean :

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;

@ManagedBean(name="helloWorld")
@SessionScoped
public class HelloWorld{

    @ManagedProperty(value="Hello World")
    private String a;

public String getA() {
    return a;
}

public void setA(String a) {
    this.a = a;
}

}

And my page :

<h:head></h:head>

<h:body>

<p:outputLabel for="extended"  />  
            <p:inputText id="extended" value="#{helloWorld.a}" />

</h:body>

</html>

The page only shows an empty text field.

  • 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-06-10T20:10:07+00:00Added an answer on June 10, 2026 at 8:10 pm

    You don’t have to specify just place the annotations above your class name , like this
    It will find them by itself…

    @ManagedBean
    @SessionScoped
    public class MyBean {
    

    instead of

    @ManagedProperty(value="Hello World")
    private String a;
    

    just do

    private String a = "Hello World";
    

    this is not how ManagedProperty are used, do some google about it

    in general ManagedProperty are for injecting values / beans

    here an example how to inject another bean

    @ManagedProperty(value = "#{someOtherBean }")
    private SomeOtherBean someOtherBean ; // + getter and setter
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application which uses URLs that look like this: http://library.example.com/Register.aspx?query=academic&key=586c70bb-5683-419c-aae9-e596af9ab66a (The
I have a j2ee web application which uses log4j for logging. I want to
I have J2EE web application which uses JSF framework. Now I am trying to
I have a web application which uses the globalization values being passed from sql
Suppose I have a web application, which uses jQuery for Ajax and UI. Now
I have a web application that uses a library which resides in TOMCAT_HOME/common/lib. This
I have a currency converter application for iphone which uses web service. The web
I have a web-application which uses hibernate and for some reason every thread (httprequest
I have a web application which uses membership and profiles. I successfully used the
I have a web application code which uses jsp, servlet and ejb. I created

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.