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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:17:06+00:00 2026-06-07T21:17:06+00:00

Am using JSF 1.2 . Am setting parameters like below, <h:commandLink id=sendParam action=#{myBean.redirectToLogin} >

  • 0

Am using JSF 1.2 . Am setting parameters like below,

<h:commandLink id="sendParam" action="#{myBean.redirectToLogin}" >
   <f:param name="userData" value="#{myBean.msg}"></f:param>
</h:commandLink>

I want to retrieve the parameter (userData) in a JSP page which is in some other web application. I am hitting that JSP page(lets say myJSP.jsp) from the web application where above code is written. Code is as below,

String link = http://myDomain/myJSP.jsp
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
externalContext.redirect(link.trim());

Most importantly : A new session id will be created when the JSP page is hit. (This is because of some other requirement in my web application)

Am trying to retrieve the parameter by using below code in myJSP.jsp.

String requestmsg = (String) req.getParameter("userData");

But, this is always null.

  1. Is my understanding correct about how f:param works? I mean, can we retrieve the parameters like how am trying, in some jsp page?

  2. If so, will the parameter value be lost if a new session is created?

Regards,

  • 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-07T21:17:08+00:00Added an answer on June 7, 2026 at 9:17 pm

    A redirect basically instructs the webbrowser to send a brand new HTTP request. The request parameters in the original JSF request are not available in that new JSP request anymore. You’d need to explicitly pass the original request parameter along that new request as well.

    String userData = externalContext.getRequestParameterMap().get("userData");
    String link = "http://myDomain/myJSP.jsp?userData=" + URLEncoder.encode(userData, "UTF-8");
    externalContext.redirect(link);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using JSF and EJB as two separate project in my application. Below
I am setting up a form using JSF (I'm pretty new at this) and
I wondered when I put below code in my JSF. <h:inputHidden id=patientId value=#{requestScope['patientId']}/> <%=request.getParameter(patientId)
I'm using JSF templates and Primefaces. Javascript code does not seem to be working
I am using JSF 2.0 and RichFaces 4. For the date input, I am
I'm using JSF 1.2 and RichFaces 3.3.3 . I work on pages designed using
I am using JSF 2.0 Mojarra. I need to create a Managed Bean that
I'm using jsf 1.2. When a particular jsp has more than one form with
I am using JSF validation to simply check that the length of a field
I'm using JSF 2.0 and it's new (actually old, but now incorporated in JSF)

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.