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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:34:54+00:00 2026-05-29T11:34:54+00:00

I am soooo confused by the playframework flash stuff….high level makes sense, put stuff

  • 0

I am soooo confused by the playframework flash stuff….high level makes sense, “put stuff in flash on the http POST to be able to retreive on the http GET after the redirect”. and I am guessing you “could” put stuff in GET request to be retrieved on next GET request but very very ick, ugh, yuck on that one since flash is shared between tabs ;).

I have the following and it requires params.flash and Validation.keep or my page stops working….(good so far)….

    if(Validation.hasErrors()) {
        params.flash(); // add http parameters to the flash scope
        Validation.keep(); // keep the errors for the next request(after redirect)
        registerCompanyPage();
    }

of course later on, I have this and adding those in BREAKS the functionality in this case….

    if(Validation.hasErrors() || !license) {
        Validation.keep(); //BREAKS functionality!!!! as errors NEVER go away now after getting them just once
        params.flash(); //BREAKS functionality as stuff NEVER goes away now
        log.info("errors="+Validation.errors());
        flash.error("Errors in form");

        log.info("company url="+company.getCompanyUrl());
        render("@registerStep2Page", user, company, license);
    }

so was registerCompanyPage doing a redirect EVEN though the code in it calls render???? (I did not post that code in here) and when I change render in my second method to redirect(), well, then I just get controller can’t be found at all and it completely stops working.

I look at all the Validation in the samples in playframework and they all do a render with no Validation.keep nor params.flash, so what is going on here? At one point, I thought I removed Validation.keep and something else broke, but can’t seem to reproduce it right now.

Anyone fully understand what is going on here?

thanks,
Dean

  • 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-05-29T11:34:55+00:00Added an answer on May 29, 2026 at 11:34 am

    Any call to a public static method invokes a redirect. (check the url in the browser to confirm if you like…i.e its not the same as the action you called as part of the POST).

    So, in your first example, you need to use flash, so that the errors are not lost following the redirect back to the original page.

    Your second example is rendering directly within the action. So, using flash, you are storing stuff up ready for the next request, which obviously is bad, as you may not have any errors.

    The examples you see online will differ for a couple of reasons. The original view was to use flash, and force a redirect back to the original page. This kept the url and the actual current page you are seeing in sync. However, as flash is a cookie, you have a limitation of storing the parameters, and error messages in a medium that can only contain 4Kb. Therefore people generally use your second method. Its not as RESTfully clean, but it does prevent the need for cookies, as there is no redirect.

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

Sidebar

Related Questions

Soooo, I am starting this new job soon where most of the code is
I'm a bit confused about displaying data from a MySQL database. I would like
Soooo we have this system here that's working as follows: We have a Java
soooo i have this function that prints one of 5 random texts ON an
I've added a lightbox jQuery script and all is working soooo BEAUTIFULLY, until I
Soooo... I was working on this page using jsFiddle and it doesn't work the
I've had soooo much trouble getting this code to work properly!!!! It runs fine
This is soooo weird. I cannot seem to get any output messages from Sys.Debug
I read this article, the parts of Intellisense and Generated Code: http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html Do you
So, I recently switched from BlueJ to Eclipse (Its soooo much better!), and while

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.