All Downloads are FREE. Search and download functionalities are using the official Maven repository.

skinny.controller.feature.FlashFeature.scala Maven / Gradle / Ivy

There is a newer version: 2.1.2
Show newest version
package skinny.controller.feature

import skinny.controller.Flash
import skinny.micro.SkinnyMicroBase
import skinny.micro.base.BeforeAfterDsl
import skinny.micro.contrib.FlashMapSupport

/**
 * Easy-to-use Flash support.
 */
trait FlashFeature extends FlashMapSupport with BeforeAfterDsl {

  self: SkinnyMicroBase with RequestScopeFeature =>

  // just set Flash object to request scope
  before() {
    if (requestScope.get(RequestScopeFeature.ATTR_FLASH).isEmpty) {
      set(RequestScopeFeature.ATTR_FLASH, Flash(flash(context)))(context)
    }
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy