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

  • Home
  • SEARCH
  • 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 3787258
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:48:46+00:00 2026-05-19T11:48:46+00:00

I am using Sun JSF 2.0 and wrote a phase listener extending javax.faces.event.PhaseListener .

  • 0

I am using Sun JSF 2.0 and wrote a phase listener extending javax.faces.event.PhaseListener. I am able to log source URI, target URI, total time and so on. But so far unable to log the ManagedBean and corresponding method that would be invoked during that client event. How can I do this?

  • 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-19T11:48:47+00:00Added an answer on May 19, 2026 at 11:48 am

    Input components send their client ID as request parameter name in case of synchronous requests and as request parameter value of javax.faces.source request parameter in case of asynchronous (ajax) requests. Just loop through the request parameters and check if an UICommand compnonent is resolveable by UIViewRoot#findComponent() based on this information and then handle accordingly.

    Kickoff example:

    @Override
    public void beforePhase(PhaseEvent event) {
        FacesContext context = event.getFacesContext();
    
        if (context.isPostback()) {
            UICommand component = findInvokedCommandComponent(context);
    
            if (component != null) {
                String methodExpression = component.getActionExpression().getExpressionString(); 
                // It'll contain #{bean.action}.
            }
        }
    }
    
    private UICommand findInvokedCommandComponent(FacesContext context) {
        UIViewRoot view = context.getViewRoot();
        Map<String, String> params = context.getExternalContext().getRequestParameterMap();
    
        if (context.getPartialViewContext().isAjaxRequest()) {
            return (UICommand) view.findComponent(params.get("javax.faces.source"));
        } else {
            for (String clientId : params.keySet()) {
                UIComponent component = view.findComponent(clientId);
    
                if (component instanceof UICommand) {
                    return (UICommand) component;
                }
            }
        }
    
        return null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using primefaces library this is my jsp page source: <%@taglib uri=http://primefaces.prime.com.tr/ui prefix=p%>
I'm writing a Java application that runs on Linux (using Sun's JDK). It keeps
Using the Sun Java VM 1.5 or 1.6 on Windows, I connect a non-blocking
I have been using com.sun.org.apache.xpath.internal.XPathAPI for some time and it seems to work ok.
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I'm using JSF 2.0 with Facelets in a Java EE 6 application server (GlassFish
As a java web applications developer I have used this last year JSF (SUN)
OK, so I am trying to set up a simple JSF application. I'm using
;Hi, I am using JSF 2.0 Mojarra ver. 2.0.2-SNAPSHOT (obtain using maven). I am
In JSF application we are using richfaces (Final.3.3.3). In pom.xml there is dependency on

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.