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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:16:34+00:00 2026-06-18T17:16:34+00:00

I have a few hiden fields in my .xhtml page. <h:inputHidden value=1 id=hidePrev/> …..

  • 0

I have a few hiden fields in my .xhtml page.

<h:inputHidden value="1" id="hidePrev"/>
.....
<h:inputHidden value="1" id="hideNext"/>

And I can’t catch their values from my JSF bean.

public class FacesUtil {
public static Object getMapValue(String key) {
    return FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get(key);
}

public static void setMapValue(String key, Object value) {
    FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().put(key, value);
}

}

My bean code:

    nextFlag = (String)FacesUtil.getMapValue("hideNext");
    prevFlag = (String)FacesUtil.getMapValue("hidePrev");

Fields nextFlag and prevFlag are still empty. They have getter and setter methods. I’m using JSF 2.2 ver. Please, help me to resolve this problem.

  • 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-18T17:16:36+00:00Added an answer on June 18, 2026 at 5:16 pm

    The <h:inputHidden> isn’t intented to add custom request parameters to the form submit. It’s intented to remember already-definied bean properties across postbacks. For adding custom request parameters, you should be using <f:param> in command components or “plain vanilla” <input type="hidden"> instead.

    Thus, so

    <h:commandButton ...>
        <f:param name="prev" value="1" />
        <f:param name="next" value="1" />
    </h:commandButton>
    

    or so

    <input type="hidden" name="prev" value="1" />
    <input type="hidden" name="next" value="1" />
    <h:commandButton ... />
    

    Either way, the values are in a request scoped bean available as

    @ManagedProperty("#{param.prev}")
    private String prev;
    
    @ManagedProperty("#{param.next}")
    private String next;
    

    Or in a broader scoped bean as

    String prev = externalContext.getRequestParameterMap().get("prev");
    String next = externalContext.getRequestParameterMap().get("next");
    

    Please note that you confused request parameters with application scoped attributes. This is seriously a pretty major mixup which proves that you have no idea what you’re doing. I strongly recommend to take a pause and go through a basic JSF tutorial once again.

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

Sidebar

Related Questions

I have a few values that I've put in some hidden fields of a
I have a long signup form and would like to hide a few fields
I have few text fields like SSN , phone number and email id. I
I have few question in this regard When you create an internet page, does
I have a few models in my MVC3 web app that have fields that
I have a form with a few input fields spread throughout the markup. What
I have a web page that has a few text boxes, and a dual
I have a few fields that I don't want to appear in the report.
I have few tables on the page and I need to run a loop
I have few form fields, each input and label is wrapped inside a div

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.