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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:22:26+00:00 2026-05-31T14:22:26+00:00

I have a page with datatable with product information from which at a product

  • 0

I have a page with datatable with product information from which at a product selection action I redirect to product info page passing a parameter:

configurableNavigationHandler.performNavigation("productInfo?faces-redirect=true&prId=" + selectedCpl.getP().getPrId());

In my viewscoped bean in my init method I get the request parameter and fill the objects needed:

@ManagedBean
@ViewScoped
public class ProductInfo implements Serializable {

private Product p;
private Integer prId;

@PostConstruct
private void init() {
    HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
    if (request.getParameter("prId") != null) {
        prId = Integer.parseInt(request.getParameter("prId"));
        p = pf.find(prId);

On my productInfo.xhtml I have a product info view and a dialog to edit the product info but when I press submit my the request parameter is null:

<p:commandButton styleClass="button-edit" value="Submit" actionListener="#{productInfo.saveProduct()}" update="prodInfo" oncomplete="dlg.hide();"/>  

I’m using jsf 2.0 with primefaces elements.

Can anyone help me? Thank you.

  • 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-31T14:22:27+00:00Added an answer on May 31, 2026 at 2:22 pm

    That’s not a session parameter. That’s a request parameter. That it’s null is because you are not sending it along with the submit request. Send it by <f:param>.

    <p:commandButton ...>
        <f:param name="prId" value="#{productInfo.prId}" />
    </p:commandButton>
    

    Unrelated to the concrete problem, there are several other potential problems. First, the view scoped bean should not be recreated when you submit the form. Perhaps you’re using tag handlers in the view. Second, you should absolutely avoid hauling the raw javax.servlet API from under the JSF covers as much as possible. Use ExternalContext#getRequestParameterMap() instead. Third, the <f:viewParam> is much cleaner than that postconstruct. Fourth, redirecting by a navigation handler smells like a design problem in the view, e.g. why not use just a GET link?

    The in-depth explanations on all of those issues are available in Communication in JSF 2.0.

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

Sidebar

Related Questions

----> I have datatable which is passing to another page in session variable. ---->
I have page which is redirected from htaccess. now I can pass the German
I have a page with a datatable that reads data from a service class.
I have jsf page: .... <form jsfc=h:form action=> <h:dataTable value=#{newMusician.strings} var=preferredMusicGenre id=musicGenresSelectTable> <h:column> <h:inputText
Our page has a datatable which shows records from a web service. The web
I have an ASP.NET DataTable which I am populating from another set of ASP:TextBox
I have a web page which uses in PHP and a jQuery DataTable to
I have a jsp page which I'm using to display a datatable. If I
I have a page that is generated which inserts an HTML comment near the
I have a page upon which a user can choose up to many different

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.