skinny.engine.base.ResponseStatusAccessor.scala Maven / Gradle / Ivy
package skinny.engine.base
import skinny.engine.SkinnyEngineBase
import skinny.engine.context.SkinnyEngineContext
import skinny.engine.implicits.ServletApiImplicits
import skinny.engine.response.ResponseStatus
/**
* Provides accessor for response status.
*/
trait ResponseStatusAccessor extends ServletApiImplicits { self: SkinnyEngineBase =>
/**
* Gets the status code of the current response.
*/
def status(implicit ctx: SkinnyEngineContext = context): Int = ctx.response.status.code
/**
* Sets the status code of the current response.
*/
def status_=(code: Int)(implicit ctx: SkinnyEngineContext = context): Unit = {
ctx.response.status = ResponseStatus(code)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy