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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:30:09+00:00 2026-06-13T11:30:09+00:00

I have the following page: <?xml version=’1.0′ encoding=’UTF-8′ ?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML

  • 0

I have the following page:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"        
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:p="http://primefaces.org/ui"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets">



<h:head>
    <title>Fire - Registration</title>
</h:head>

<h:body>

    <f:view>
        <f:event type="preRenderView" listener="#{confirmPasswordResetBean.bindSessionKey()}"/>
    </f:view>

    <p:growl id="growl" showDetail="true" life="5000" />

    <h:form>

        <p:panel header="Select your new password">

            <h:panelGrid columns="2" cellpadding="5">

                <p:outputLabel for="newPassword" value="Type your new password"/>
                <p:password id="newPassword" 
                            value="#{confirmPasswordResetBean.firstPassword}"
                            feedback="true"/>

                <p:outputLabel for="retypedPassword" value="Retype your password"/>
                <p:password id="retypedPassword" 
                            value="#{confirmPasswordResetBean.secondPassword}"/>

            </h:panelGrid>

            <p:commandButton id="confirmButton" 
                             value="reset" 
                             action="#{confirmPasswordResetBean.doResetPassword()}"
                             update=":growl"/>

        </p:panel>       

    </h:form>

</h:body>

The backing bean used above is RequestScoped, and the page itself takes a single parameter (sessionKey)…what I want to do is to:
1. Bind sessionKey to a variable in the backing bean. This is straightforward enough.
2. Use the bound value of sessionKey when executing dedicated logic in the same bean, when the client presses the commandButton.

The problem is that pressing the button starts a new request, which invalidates both the current bean (with the bound value), as well as the external page context…I thus lose all means to get a hold of sessionKey from either the bean or the page parameters…how can I resolve this? I am relatively new to both web programming and JSF, so pardon me if this has an obvious answer.

  • 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-13T11:30:11+00:00Added an answer on June 13, 2026 at 11:30 am

    Either put the bean in the view scope, so that it lives long as you’re interacting with the same view, or pass the request parameter by <f:param> to the subsequent requests.

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

    By the way, you’d rather have used <f:viewParam> to bind the request parameter to the bean directly.

    <f:metadata>
        <f:viewParam name="sessionKey" value="#{bean.sessionKey}" />
    </f:metadata>
    

    See also:

    • What can <f:metadata>, <f:viewParam> and <f:viewAction> be used for?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following snippet: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
Trying to use JSTL but have the following problem: Index.xhtml page: <?xml version=1.0 encoding=UTF-8?>
I have the following invalid XML file: <?xml version=1.0 encoding=utf-8 ?> <Page num=1 crop_box=0,
I have the following XML schema: <?xml version=1.0 encoding=utf-8?> <PageMapping> <Applications> <Application name=xxx> <Page
I have the following XML <?xml version=1.0 encoding=ISO-8859-1?> <?xml-stylesheet type=text/xsl href=example3.xsl?> <pics> <page no=1>
I have the following xsl <?xml version=1.0 encoding=windows-1251?> <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform> <xsl:param name=currentPage>Buildings</xsl:param> <xsl:template
I have the following XML: <data> <page id=1118> <itms> <values> <value>1104</value> </values> </itms> </page>
I have the following HTML page and the background color for the content is
I have the following jQueryMobile page anatomy at index.html: <div data-role=page> <div data-role=header>...</div> <div
I have the following XML: <system-folder> <system-folder> <system-page> <display-name>One</display-name> </system-page> </system-folder> <system-folder> <system-page> <display-name>Two</display-name>

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.