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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:27:59+00:00 2026-06-11T17:27:59+00:00

I have seen this question ask around a lots, however, none was properly answered

  • 0

I have seen this question ask around a lots, however, none was properly answered so I decided to ask again. So if I have this: if I am in A.xhtml and I

<ui:include src="B.xhtml">
    <ui:param name="formId" value="awesome Id"/>
</ui:include>

so in B.xhtml, I can do this

<h:outputText value="#{formId}"/>

when I run A.xhtml, I would see awesome Id get printed on the screen. However how do I access the value of formId in the backing bean. I look inside FacesContext.getCurrentInstance().getAttributes() and FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap() and I just cannot seems to locate it. To go a bit further, so I try:

Inside B.xhtml, I now have

<h:inputHidden id="hiddenFormId" value="#{formId}"/>
<h:outputText value="#{formId}"/>

the idea is that I can access the value of formId in the RequestParameterMap under key hiddenFormId. But now if I have:

<h:form id="myForm">
        <ui:include src="B.xhtml">
            <ui:param name="formId" value="awesome Id"/>
        </ui:include>
        <a4j:commandButton render="myForm" value="My Button"/>
</h:form>

then I would get this erro if I look inside the POST request (when inside chrome or ff debug mode)

<partial-response><error><error-name>class javax.faces.component.UpdateModelException</error-name><error-message><![CDATA[/B.xhtml @9,61 value="${formId}": /index.xhtml @27,61 value="awesome Id": Illegal Syntax for Set Operation]]></error-message></error></partial-response>

so How to access ui:param value in the managed bean?

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

    Where the <ui:param> is under the covers stored is actually implementation dependent. In Mojarra it’s stored as an attribute of the FaceletContext and thus available in your backing bean as follows:

    FaceletContext faceletContext = (FaceletContext) FacesContext.getCurrentInstance().getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
    String formId = (String) faceletContext.getAttribute("formId");
    

    Whether the value would be available is however subject to timing. If your backing code is running while executing the rendering of the include, then it’ll be available, else it’ll be null.

    I recall that MyFaces does it a bit differently, but I don’t recall the details anymore and I don’t have its source at hand right now.

    As to your <h:inputHidden> attempt, the <h:inputHidden> isn’t well suited for the sole purpose of passing view-definied hidden parameters along with the form submit. Just use plain HTML instead.

    <input type="hidden" name="hiddenFormId" value="#{formId}" />
    

    It’ll be available as a request parameter with exactly this name.

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

Sidebar

Related Questions

I have seen a question on here about this however it was old so
I have seen this question and its answers and they clear up some of
I have seen this question that talks about getting the last part of a
I have seen this question about deploying to WebSphere using the WAS ant tasks.
In Microsoft SQL Server: I have seen this question several times, but can't see
Recently I have seen this code in a WebSite, and my question is the
This question may seem a little bit stackoverflow-implementation specific, but I have seen a
I have seen many answers for this type of question but its not related
I have seen there is no question that specifically reply to this combination of
This question seems to have been asked a lot, but I haven't seen an

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.