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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:14:05+00:00 2026-05-31T08:14:05+00:00

Suppose I have a JSF bean with @PostConstruct method. I would like to know

  • 0

Suppose I have a JSF bean with @PostConstruct method.
I would like to know which entity referenced the current bean and caused its initialization.

@PostConstruct
public void init() {
  logger.info(... Who initialized me? ...);
}
  • 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-31T08:14:07+00:00Added an answer on May 31, 2026 at 8:14 am

    This information is not available in the JSF context. If you’re using Mojarra, you’d need to run the debugger and put a breakpoint on ManagedBeanBuilder#bake() method.

    Or if you need this information during runtime for some unobvious reason, then you’d need to let the caller set itself in the setter of the @ManagedProperty referencing the bean.

    @ManagedBean
    @RequestScoped
    public class Parent {
    
        @ManagedProperty("#{child}")
        private Child child;
    
        public void setChild(Child child) {
            this.child = child;
            this.child.setParent(this);
        }
    
        // ...
    }
    

    then you can gather this information in the setParent() method.

    public void setParent(Object parent) {
        logger.info(parent + " has initialized me");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a number of related classes that all have a method like
Suppose I have a data frame, df, that looks like: f t1 t2 t3
We have an application which is built on JSF 2.0(MyFaces) and runs on Weblogic
Suppose i have an XML file, that i use as local database, like this):
Suppose that I have Spring service classes or JSF beans. I wire these classes
Suppose have following beach definition: <bean id=singletonBean class=...> <property name=instanceBean ref=instanceBean/> </bean> <bean id=instanceBean
Suppose I have a collection with some set of documents. something like this. {
Suppose I have an entity class that stores a username: class Profile { private
Suppose I have an interface called Interface, and a concrete class called Base, which,
Suppose you have 2 different ASP.NET applications in IIS. Also, you have some ASCX

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.