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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:06:09+00:00 2026-06-13T22:06:09+00:00

I am migrating an old JSF application from WebSphere to JBoss: the old version

  • 0

I am migrating an old JSF application from WebSphere to JBoss: the old version uses an IBM implementation of JSF. My question concerns the following component:

<hx:scriptCollector id="aScriptCollector"
        preRender="#{aBean.onPageLoadBegin}" postRender="#{aBean.onPageLoadEnd}">

To reproduce the preRender behavior in JSF 2 I use a binding for the form (s. here). My questions:

1) Do you know a trick for simulating postRender in JSF 2?

2) Do you think is the trick I am using for preRender “clean”?

Thanks a lot for your help!
Bye

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

    Closest what you can get to achieve exactly the same hooks is

    <f:view beforePhase="#{bean.beforePhase}" afterPhase="#{bean.afterPhase}">
    

    with

    public void beforePhase(PhaseEvent event) {
        if (event.getPhaseId == PhaseId. RENDER_RESPONSE) {
            // ...
        }
    }
    
    public void afterPhase(PhaseEvent event) {
        if (event.getPhaseId == PhaseId. RENDER_RESPONSE) {
            // ...
        }
    }
    

    The preRender can be achieved in an easier manner, put this anywhere in your view:

    <f:event type="preRenderView" listener="#{bean.preRenderView}" />
    

    with

    public void preRenderView(ComponentSystemEvent event) {
        // ...
    }
    

    (the argument is optional, you can omit it if never used)


    There’s no such thing as postRenderView, but you can easily create custom events. E.g.

    @NamedEvent(shortName="postRenderView")
    public class PostRenderViewEvent extends ComponentSystemEvent {
    
        public PostRenderViewEvent(UIComponent component) {
            super(component);
        }
    
    }
    

    and

    public class PostRenderViewListener implements PhaseListener {
    
        @Override
        public PhaseId getPhaseId() {
            return PhaseId.RENDER_RESPONSE;
        }
    
        @Override
        public void beforePhase(PhaseEvent event) {
            // NOOP.
        }
    
        @Override
        public void afterPhase(PhaseEvent event) {
            FacesContext context = FacesContext.getCurrentInstance();
            context.getApplication().publishEvent(context, PostRenderViewEvent.class, context.getViewRoot());
        }
    
    }
    

    which you register in faces-config.xml as

    <lifecycle>
        <phase-listener>com.example.PostRenderViewListener</phase-listener>
    </lifecycle>
    

    then you can finally use

    <f:event type="postRenderView" listener="#{bean.postRenderView}" />
    

    with

    public void postRenderView(ComponentSystemEvent event) {
        // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am migrating an old JAX-WS 2.1 web service from JBoss 4 to Websphere
I've recently done a migration from a really old version of some application to
I'm migrating an old app that uses application.cfm to use an application.cfc. The CFM
I'm migrating old projects from JSF 1.2 to JSF 2.0. The projects are JSP
I'm migrating an old vb desktop app to an ASP.NET web application version. The
i'm with a problem migrating an old application from MyFaces 1.1 to MyFaces 1.2.
I'm currently migrating old web apps from JBoss As 4.2.2 to 6.0.0 (AS6) .
Quick one. I'm in the process of migrating an old web application that uses
We are done migrating a website from old CMS to SDL Tridion. We have
I'm migrating a Delphi project from old Delphi 2.0 IDE to the new RAD

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.