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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:56:11+00:00 2026-05-26T20:56:11+00:00

I am having a simple application with one entity. The entity is Car so

  • 0

I am having a simple application with one entity. The entity is Car so I have made CRUD methods and a “get all cars” method. I am using JSF to make a website where I have the list of cars with a edit/show/delete link next to it. Instead of using POST I want to use GET on the show/edit links. So far I have used the h:link with the id as a parameter and I set them in the show page as viewParams.

The whole application works but I have a question. Currently I am doing the EJB invocation that finds the appropiate car from the ID in the set-method for a car ID in the backing bean. I have not found another way of doing this so I wonder if this is correct? Because I don’t have an action method that is invoked the same way as h:commandButton and return the string for the page that it shall navigate to.

  • 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-26T20:56:12+00:00Added an answer on May 26, 2026 at 8:56 pm

    You can use <f:event type="preRenderView"> to trigger a view action before the view is rendered.

    E.g.

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

    with

    @ManagedBean
    @ViewScoped
    public class Cars {
    
        private Long id;
        private Car car;
    
        @EJB
        private CarService service;
    
        public void init() {
            car = service.find(id);
        }
    
        // ...
    }
    

    Note that in upcoming JSF 2.2, the <f:event type="preRenderView"> can be replaced by the new <f:viewAction> which is more self-documenting:

    <f:metadata>
        <f:viewParam name="id" value="#{cars.id}" />
        <f:viewAction action="#{cars.init}" />
    </f:metadata>
    

    See also:

    • Communication in JSF 2.0 – Processing GET request parameters
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails 3 simple scaffolded application having one model like that: class
I really need help on this one. I am having a simple login form
I'm having trouble sending out a simple HTTP request using Actionscript 3's Socket() object.
I'm having a simple ASP.NET application hosted on my local IIS6, under Vista. It
in a simple drawing application I have a model which has a NSMutableArray curvedPaths
I have written a simple feedback application in django. It's not particulairly complex, basically
I am writing a simple console application in Objective-C but I have heard that
I am having this kind of mysterious issue here. I am currently using Entity
I'm using the MVC beta to write a simple application to understand ASP.Net MVC.
I have a simple C# 2008 application which displays a png-picture and handles some

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.