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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:11:41+00:00 2026-06-15T18:11:41+00:00

I thought about using flash scope to save the previous site uri to allow

  • 0

I thought about using flash scope to save the previous site uri to allow back redirection on the target site.

On the main site ajax calls a bean method to save the current URI in the flash and navigate to the target sub site provided as an parameter.

On the sub site a simple navigate method from the bean is called using the previously stored uri from the flash.

Here is the problem:
The data in the flash is empty, but when i print it out on the site its correct.

Sub site

#{flash.PREVIOUS_URI}
<h:form>
    <h:commandLink value="Redirect from flash" 
        action="#{bean.navigate(flash.PREVIOUS_URI)}"/>
</h:form>

public String navigate(final String outcome)
{
    return outcome;
}

Is the flash.PREVIOUS_URI in the action call evaluated on the next request resulting in the flash value being empty?

Or how do i save it as a var on the site to make it work? <c:set> seems not to work.

  • 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-15T18:11:42+00:00Added an answer on June 15, 2026 at 6:11 pm

    The action attribute of <h:commandLink> is evaluated during invoke action phase of the postback request and not during the render response phase of the initial request, as you seemed to expect. Thus, the flash scoped attribute would not be available anymore during invoking the action.

    Your best bet is to pass it as <f:param> instead:

    <h:commandLink value="Redirect from flash" action="#{bean.navigate}">
        <f:param name="previousURI" value="#{flash.PREVIOUS_URI}" />
    </h:commandLink>
    

    You can get it by @ManagedProperty("#{param.previousURI}"), <f:viewParam name="previousURI">, or ExternalContext#getRequestParameterMap().


    Alternatively, if this is really all you basically have (and you basically don’t need to perform any business action), then you could also just use <h:link> instead.

    <h:link value="Redirect from flash" outcome="#{flash.previousURI}" />
    

    This way the <h:form> is not needed and you also end up with a fullworthy <a> element which is bookmarkable and searchbot-indexable.

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

Sidebar

Related Questions

I know this might sound easy. I thought about using the first dot(.) which
We have some performance problems with one of our applications. I thought about using
i'm trying to get computer's state in my LAN... thought about using QTcpSocket but
We have a project that’s using many C++11 facilities, and we thought about this
I'm new in using GWT. When I heard about GWT I thought than I
I thought about the following question about computer's architecture. Suppose I do in Python
I thought about migrating subversion a lot and I have several questions still open.
I have never thought about until recently, but I'm not sure why we call
I just thought about the non-blocking infrastructure of tornado and event-driven programming. Actually I'm
I had thought about decorating various control items with attributes to declare group ownership,

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.