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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:19:45+00:00 2026-06-15T13:19:45+00:00

With requestscoped beans managed by JSF (@Managedbean) you can get the value of a

  • 0

With requestscoped beans managed by JSF (@Managedbean) you can get the value of a request parameter with @ManagedProperty(“#{param.id}”).

If the request is a GET request, you can get the value of a request parameter with f:viewParam.

Is there a special mechanism to get the value of a request parameter when the bean is CDI managed (@Named) and the request is a POST request? I only know the Java code

FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id");
  • 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-15T13:19:46+00:00Added an answer on June 15, 2026 at 1:19 pm

    The <f:viewParam> works as good in POST requests.

    You should only keep in mind that this runs during apply request values phase only, not during render response phase. So, if you’re actually navigating on an action method and expecting the parameter to be set as view parameter of the target page, then you’re wrong. It will only be set on the view where the POST request is actually submitting to.

    As an evidence that the <f:viewParam> works on POST as well, here’s a test snippet:

    <f:metadata>
        <f:viewParam name="foo" />
    </f:metadata>
    <h:form>
        <h:commandButton value="submit">
            <f:param name="foo" value="bar" />
        </h:commandButton>
    </h:form>
    <p>foo: #{foo}</p>
    

    Pressing the submit button will show up foo: bar.

    You need to solve your concrete functional requirement in a different manner. As you didn’t tell anything about the concrete functional requirement in your question, it’s not possible to give an elaborate answer on that. Here are at least some hints:

    1. @Inject target bean and set it as property during action method.
    2. Use <f:setPropertyActionListener>.
    3. Use flash scope.
    4. Send a redirect with parameter in query string.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All of my JSF 2.0 Managed Beans are Request Scoped. Do I need to
I have a project using JSF primefaces and EJB managed Beans with hibernate storage.
I have the following 2 ManagedBean: @ManagedBean @ViewScoped public class MakeReservation { ... @ManagedProperty(value=#{cartManagedBean})
I am using JSF-Spring integration, I am calling a Spring-managed request scoped bean method
I am trying to use spring to provide managed beans to jsf. I assume
I have a request scoped CDI manage bean(Also tried with jsf managed bean but
I'm using JSF 2.0 with GlassFish 3.0. I have the following Managed Bean: @ManagedBean
I would like to make use of request scoped beans in my app. I
Inside my JSF I did <h:outputLabel value=Group: for=group /> <h:inputText id=group value=#{newUserController.group.groupKey.groupId} title=Group Id
If I had a managed bean as follows: @ManagedBean @RequestSchoped public class Example {

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.