In terms of a implementation of flash message in Play, I saw two ways.
Those are flash(flashKey, flashMessage) and flash().put(flashKey, flashMessage) where both flashKey and flashMessage are String.
What exactly is the difference?
What is the difference between flash(a, b) and flash().put(a, b) in PlayFramework?
113 Views Asked by Kazuya Tomita At
1
There are 1 best solutions below
Related Questions in PLAYFRAMEWORK
- Install Play 1.7.1 on Windows
- Handling of WebSocket Client Messages in Play Framework
- Handling WebSocket Connections in Play Framework
- Handling WebSocket Connections in Play Framework in Scala
- build.sbt error: value addRepositoryAuthentication is not a member of lmcoursier.CoursierConfiguration
- How to log incoming request with Scala & Play Framework?
- Optionally enable Scala play to accept mLTS credentials?
- reactivemongo with scala3, pekko, play-3
- Specs 2 - I want to mock one of the injected modules into the controller class
- Scala3 equivalent to -Wconf src filter
- Using Selenium in Scala play not only for testing
- How to execute PUT REST client code using playframework in scala
- ERROR akka.actor.ActorSystemImpl(applica Uncaught error from thread, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem
- Autogenerating unnapply for play form handling in scala3 for single-element case classes
- Play framework + Java +Ebean models.Donation is NOT an Entity Bean registered with this server?
Related Questions in PLAYFRAMEWORK-2.2
- JsLookup on multiple level array using play Json library (or any other suggestion)
- Play Framework cannot find QueryStringBinders
- Using MockitoSugar of scalatestplus-play deprecated
- Unsupported class file major version 58 on Play Java Starter Example when using Ebean
- Best practice to check contains key and check for null/empty in JSON?
- remove route listing in playframework
- How to load Evolutions script (database migration scripts) from external folder or external jar?
- Steps needed to connect with H2 database with Play framework 2.0
- multiple playframwork applications run scheduled task multiple times
- WebSocket in play 2.6
- Play 2.2.2 with Java 11
- Cache solution to manage external api calls using play framework
- Exclude specs2 as transitive dependency of play framework in sbt
- Scala - How to implement implicit JSON reader
- Update a config value with compile time Dependency Injection in Play Java framework
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
flash().put(key, message)is the Flash class interface for adding the given value the flash scopeflash(key, message)is the RequestBuilder interface for updating the flash session. Under the hood it does exactly the same asnew HashMap<>(flash()).put(key, message)(source here) but it looks like it does the additional step of updating the request cookiesI believe you should use
flash(key, message)to ensure that any updates to the flash are persisted.