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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:44:39+00:00 2026-05-27T15:44:39+00:00

My problem is that the value of the parameter is null in the bean

  • 0

My problem is that the value of the parameter is null in the bean

In the xhtml I have this code:

<h:commandLink action="#{navigation.editNews}" value="#{new.title}">            
  <f:param name="newsId" value="#{new.id}" />      
</h:commandLink>

In Navigation I redirect to news.xhtml

public String editNews(){
    return "editNews";
}

This is the code in faces-config.xml

<navigation-case>
  <from-action>#{navigation.editNews}</from-action>
  <from-outcome>editNews</from-outcome>
  <to-view-id>/news.xhtml</to-view-id>
  <redirect />
</navigation-case>

I have a bean where I call method when I push a button in news.xhtml and I try to get param but it is null

FacesContext fc = FacesContext.getCurrentInstance();
Map<String,String> params = fc.getExternalContext().getRequestParameterMap();
String = params.get("newsId"); 
  • 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-27T15:44:40+00:00Added an answer on May 27, 2026 at 3:44 pm

    The <f:param> adds a request parameter. So this parameter has a lifetime of exactly one HTTP request. You’ve a <redirect/> in your navigation case which basically instructs the webbrowser to send a new request on the given location. This new request does not contain the parameter anymore.

    You’ve basically 2 options:

    1. Get rid of <redirect /> in the navigation case.

    2. Make it a normal GET request instead. If you’re on JSF2, use <h:link> instead.

      <h:link action="news" value="#{news.title}">            
          <f:param name="newsId" value="#{news.id}" />      
      </h:link>
      

      Or if you’re still on JSF 1.x (the usage of navigation cases less or more hints this as they are superfluous in JSF 2 thanks to the new implicit navigation feature; or you must be reading outdated tutorials/books/answers targeted on JSF 1.x; also the absence of JSF 2.0 tag on your question is suspicious), then use a normal <a> link instead.

      <a href="news.xhtml?newsId=#{news.id}">#{news.title}</a>
      

    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 query string parameter value that contains an ampersand. For example, a
The problem is this: I want a generic function that has an out-parameter of
I'm having a problem with a cocoa application that takes the value of a
I have the problem, that MSSQL Server 2000 should select some distinct values from
One problem that I come across regularly and yet don't have a solution to
A problem that has frequently come up in my career is I have some
I have a problem that confuses my users, being that although an item is
This has been a problem that I haven't been able to figure out for
I have the problem that an specific step in Ant can only be executed
Hy Guys, I have to pass in a method action a string parameter, because

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.