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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:25:11+00:00 2026-05-27T02:25:11+00:00

At the moment I am using the following code: public void init() { question

  • 0

At the moment I am using the following code:

public void init() {
    question = questionBean.findQuestion(questionParamId);
}

Which is invoked by this:

<f:metadata>
    <f:viewParam name="id" value="#{questionShowBackingBean.questionParamId}" />
    <f:event type="preRenderView" listener="#{questionShowBackingBean.init}" />
</f:metadata>

So the URL is: http://www.mycompany.com/show.xhtml?id=8

Now I have begun using PrettyFaces and I have seen the <action> element in the URL-mapping element I wonder if I could have written <action>#{questionShowBackingBean.init}</action> instead?

If so should I remove metadata element then, or should I use that instead because it may in the future change from using PrettyFaces? Last, where does the invocation in the action element occur? Does it occur before the listener I have now?

  • 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-27T02:25:11+00:00Added an answer on May 27, 2026 at 2:25 am

    The <f:event> and <action> tags seem very similar, but have a few large differences that might influence your decision:

    1. <action> allows you to perform navigation by returning a navigation string.
    2. <f:event> is native JSF and lets you stay portable if you want to switch URL-rewriting tools in the future.
    3. <action> lets you choose which phase to invoke the action via the <action phaseId="..." /> attribute. <f:event> usually always invokes at the same time during RENDER_RESPONSE, after you really need it to invoke if you are using this information in JSF action method or in the INVOKE_APPLICATION phase.

    By default, <action>s are invoked after the RESTORE_VIEW phase, but as I said before, you can control this yourself.

    Usually I prefer to use <action> because it works without the need for any <f:viewParam> elements, and it also lets me navigate before any lifecycle processing has occurred (keeping things a bit more secure).

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

Sidebar

Related Questions

At the moment I'm building a list using the following code: $('<li id=li' +
I just started using django for development. At the moment, I have the following
I am using in my code at the moment a ReentrantReadWriteLock to synchronize access
I am using the following code to print a word document from a C#
I'm using the following code to resize a tif. The tif has an alpha
gcc 4.5.1 c89 I am using the following code to read in a line
So at the moment my page is currently working with the following code in
EDIT: I'm starting a bounty on this question. For the moment, I've moved on
Which of the following ways is the right one in using the characters and
Using the jQuery Cycle plugin, the following code allows user to browse the photos/:

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.