trait SockJsAction extends Actor with Action
An actor will be created when there's new SockJS session. It will be stopped when the session is closed.
- Alphabetic
- By Inheritance
- SockJsAction
- Action
- I18n
- JsResponder
- JsRenderer
- FlashResponder
- FlashRenderer
- ViewResponder
- Responder
- ViewRenderer
- GetActionClassDefaultsToCurrentAction
- Renderer
- Url
- Redirect
- BasicAuth
- Filter
- Net
- Log
- SessionEnv
- Csrf
- RequestEnv
- ParamAccess
- Actor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
Receive = PartialFunction[Any, Unit]
- Definition Classes
- Actor
Abstract Value Members
-
abstract
def
execute(): Unit
The current action is the one just before switching to this SockJS actor.
The current action is the one just before switching to this SockJS actor. You can extract session data, request headers etc. from it, but do not use respondText, respondView etc. Use respondSockJsText and respondSockJsClose.
- Definition Classes
- SockJsAction → Action
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
absSockJsUrl[T <: SockJsAction](implicit arg0: Manifest[T]): String
- Definition Classes
- Url
-
def
absUrl[T <: Action](implicit arg0: Manifest[T]): String
- Definition Classes
- Url
-
def
absUrl[T <: Action](params: (String, Any)*)(implicit arg0: Manifest[T]): String
- Definition Classes
- Url
-
def
absUrl(params: (String, Any)*): String
- Definition Classes
- Url
-
lazy val
absUrl: String
- Definition Classes
- Url
-
lazy val
absUrlPrefix: String
- Definition Classes
- Url
-
lazy val
absUrlPrefixWithoutScheme: String
- Definition Classes
- Url
-
lazy val
absWebSocketRequestUrl: String
- Definition Classes
- Url
-
def
absWebSocketUrl[T <: WebSocketAction](implicit arg0: Manifest[T]): String
- Definition Classes
- Url
-
def
absWebSocketUrl[T <: WebSocketAction](params: (String, Any)*)(implicit arg0: Manifest[T]): String
- Definition Classes
- Url
-
def
absWebSocketUrl(params: (String, Any)*): String
- Definition Classes
- Url
-
lazy val
absWebSocketUrl: String
- Definition Classes
- Url
-
lazy val
absWebSocketUrlPrefix: String
- Definition Classes
- Url
-
def
addConnectionClosedListener(listener: ⇒ Unit): Unit
- Definition Classes
- Action
-
def
afterFilter(f: ⇒ Any): Unit
- Definition Classes
- Filter
-
lazy val
antiCsrfInput: Node
- Definition Classes
- Csrf
-
lazy val
antiCsrfMeta: Node
- Definition Classes
- Csrf
-
def
antiCsrfToken: String
- Definition Classes
- Csrf
-
def
apply(handlerEnv: HandlerEnv): Unit
- Definition Classes
- RequestEnv
-
def
aroundFilter(f: (() ⇒ Any) ⇒ Any): Unit
- Definition Classes
- Filter
-
def
aroundPostRestart(reason: Throwable): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
-
def
aroundPostStop(): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
-
def
aroundPreRestart(reason: Throwable, message: Option[Any]): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
-
def
aroundPreStart(): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
-
def
aroundReceive(receive: akka.actor.Actor.Receive, msg: Any): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
lazy val
at: At
- Definition Classes
- RequestEnv
-
def
atJson(key: String): String
- Definition Classes
- RequestEnv
-
def
autosetLanguage(availableLanguages: String*): Unit
Sets current language automatically based on the matching of the "Accept-Language" header against the list of given languages.
Sets current language automatically based on the matching of the "Accept-Language" header against the list of given languages. The languages should have corresponding files
i18n/language.po
in classpath (the language should be in IETF BCP 47 format).If there's no match, the language is still the default "en".
- Definition Classes
- I18n
-
def
badRequestMessageInvalidInput(message: String): String
Applications may override this method to modify the default message:
Validation error: + message
Applications may override this method to modify the default message:
Validation error: + message
- Attributes
- protected
- Definition Classes
- Action
-
def
badRequestMessageMissingParam(param: String): String
Applications may override this method to modify the default message:
Missing param: + param
Applications may override this method to modify the default message:
Missing param: + param
- Attributes
- protected
- Definition Classes
- Action
-
def
badRequestMessageSessionExpired: String
Applications may override this method to modify the default message:
Session expired. Please refresh your browser.
Applications may override this method to modify the default message:
Session expired. Please refresh your browser.
- Attributes
- protected
- Definition Classes
- Action
-
def
basicAuth(realm: String)(authenticator: (String, String) ⇒ Boolean): Boolean
- authenticator
takes username and password, returns true if it want to let the user in.
- Definition Classes
- BasicAuth
-
def
beforeFilter(f: ⇒ Any): Unit
Adds a before filter.
Adds a before filter.
- Definition Classes
- Filter
-
lazy val
bodyFileParams: FileUploadParams
File params in request body.
File params in request body.
- Definition Classes
- RequestEnv
-
lazy val
bodyTextParams: Params
Params in request body.
Params in request body.
- Definition Classes
- RequestEnv
-
lazy val
browserLanguages: List[LanguageRange]
- returns
List of Locale.LanguageRange sorted by priority from high to low
- Definition Classes
- I18n
-
def
callAfterFilters(): Unit
Called by Dispatcher.
Called by Dispatcher. Calls all after filters.
- Definition Classes
- Filter
-
def
callBeforeFilters(): Boolean
Called by Dispatcher.
Called by Dispatcher. Calls all before filters until a filter has responded something.
- returns
false if a before filter has responded something and later before filters and the action's "execute" method should not be called
- Definition Classes
- Filter
-
def
callExecuteWrappedInAroundFilters(): Unit
Called by Dispatcher
Called by Dispatcher
- Definition Classes
- Filter
-
lazy val
channel: Channel
- Definition Classes
- RequestEnv
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
implicit
val
context: ActorContext
- Definition Classes
- Actor
-
def
convertTextParam[T](key: String, value: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T
Applications may override this method to convert to more types.
Applications may override this method to convert to more types.
- Definition Classes
- ParamAccess
-
implicit
val
currentAction: Action
Convenient implicit, for example for use when you want to get the current action in view templates.
Convenient implicit, for example for use when you want to get the current action in view templates.
- Definition Classes
- Action
-
def
dispatchWithFailsafe(skipCsrfCheck: Boolean): Unit
- Definition Classes
- Action
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
implicit
lazy val
executionContext: ExecutionContextExecutor
Convenient implicit, for example for use when you use scala.concurrent.Future.
Convenient implicit, for example for use when you use scala.concurrent.Future. It's lazy to avoid starting Akka in tests.
- Definition Classes
- Action
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flash(): String
Returns the current content in flash, and clears the flash.
Returns the current content in flash, and clears the flash.
- Definition Classes
- FlashRenderer
-
def
flash(msg: Any): Unit
- Definition Classes
- FlashRenderer
- See also
jsFlash(msg).
-
def
forwardTo(actionClass: Class[_ <: Action]): Unit
- Definition Classes
- Redirect
-
def
forwardTo[T <: Action]()(implicit arg0: Manifest[T]): Unit
Example: forwardTo[AnotherActionClass]()
Example: forwardTo[AnotherActionClass]()
Tells another action to process the current request for the current action. See also redirectTo.
- Definition Classes
- Redirect
-
val
forwarding: Boolean
Set to true by forwardTo.
Set to true by forwardTo.
- Definition Classes
- Redirect
-
def
getActionClass[T <: Action](implicit arg0: Manifest[T]): Class[Action]
- Definition Classes
- GetActionClassDefaultsToCurrentAction
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
val
handlerEnv: HandlerEnv
- Definition Classes
- RequestEnv
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
lazy val
isAjax: Boolean
- Definition Classes
- JsResponder
-
def
isDoneResponding: Boolean
- Definition Classes
- Responder
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
isSsl: Boolean
- Definition Classes
- Net
-
def
js$(selector: String): String
- Definition Classes
- JsRenderer
-
def
js$id(id: String): String
- Definition Classes
- JsRenderer
-
def
js$name(name: String): String
- Definition Classes
- JsRenderer
-
def
jsAddToView(js: Any): Unit
You can use this method to add dynamic JS snippets to a buffer, then use method jsForView to take out that buffer to embed the snippets to view template.
You can use this method to add dynamic JS snippets to a buffer, then use method jsForView to take out that buffer to embed the snippets to view template.
- Definition Classes
- JsRenderer
-
lazy val
jsDefaults: Node
- Definition Classes
- JsRenderer
-
def
jsEscape(string: Any): String
Do not use this to escape JSON, because they are different! For example JSON does not escape ' character, while JavaScript does.
Do not use this to escape JSON, because they are different! For example JSON does not escape ' character, while JavaScript does. To escape JSON, use xitrum.util.SeriDeseri.toJson(Seq(string)).
org.apache.commons.lang3.StringEscapeUtils is used internally.
- Definition Classes
- JsRenderer
-
def
jsFlashCall(msg: Any): String
- Attributes
- protected
- Definition Classes
- FlashRenderer
-
lazy val
jsForView: Any
See jsAddToView.
See jsAddToView.
- Definition Classes
- JsRenderer
-
def
jsRedirectTo[T <: Action](params: (String, Any)*)(implicit arg0: Manifest[T]): ChannelFuture
- Definition Classes
- JsResponder
-
def
jsRedirectTo(location: Any): ChannelFuture
See http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery
See http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery
- Definition Classes
- JsResponder
-
def
jsRenderFlash(): Unit
Like jsRenderFlash(msg), but uses the current flash.
Like jsRenderFlash(msg), but uses the current flash.
- Definition Classes
- FlashRenderer
-
def
jsRenderFlash(msg: Any): Unit
For web 2.0 style application.
For web 2.0 style application. Used in application layout to display the flash message right after a view is loaded.
- Definition Classes
- FlashRenderer
-
def
jsRespond(fragments: Any*): ChannelFuture
- Definition Classes
- JsResponder
-
def
jsRespondFlash(msg: Any): Unit
For web 2.0 style application.
For web 2.0 style application. Used in Ajax request handling to respond a message and have the browser render it to the flash area right away.
- Definition Classes
- FlashResponder
-
def
language: String
Default language is "en".
Default language is "en".
- Definition Classes
- I18n
-
def
language_=(language: String): Unit
Sets current language manually.
Sets current language manually. The language should have a corresponding file
i18n/language.po
in classpath (the language should be in IETF BCP 47 format).- Definition Classes
- I18n
-
def
layout: Any
- Definition Classes
- ViewRenderer
-
def
locale: Locale
The locale corresponding to the language.
-
lazy val
log: Logger
Log name is inferred from name of the class extending this trait.
Log name is inferred from name of the class extending this trait.
- Definition Classes
- Log
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newComponent[T <: Component]()(implicit arg0: Manifest[T]): T
- Definition Classes
- Action
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
onDoneResponding(): Unit
Called when the response or the last chunk (in case of chunked response) has been sent to the client.
Called when the response or the last chunk (in case of chunked response) has been sent to the client.
- Definition Classes
- Responder
-
def
param[T](key: String, coll: Params)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], d: DefaultsTo[T, String]): T
- Definition Classes
- ParamAccess
-
def
param[T](key: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], d: DefaultsTo[T, String]): T
- Definition Classes
- ParamAccess
-
def
paramo[T](key: String, coll: Params)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], d: DefaultsTo[T, String]): Option[T]
- Definition Classes
- ParamAccess
-
def
paramo[T](key: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], d: DefaultsTo[T, String]): Option[T]
- Definition Classes
- ParamAccess
-
def
params[T](key: String, coll: Params)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], d: DefaultsTo[T, String]): Seq[T]
- Definition Classes
- ParamAccess
-
def
params[T](key: String)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T], d: DefaultsTo[T, String]): Seq[T]
- Definition Classes
- ParamAccess
-
lazy val
pathParams: Params
Params embedded in the path.
Params embedded in the path. Ex: /articles/:id
- Definition Classes
- RequestEnv
-
def
postRestart(reason: Throwable): Unit
- Definition Classes
- Actor
- Annotations
- @throws( classOf[java.lang.Exception] )
-
def
postStop(): Unit
- Definition Classes
- SockJsAction → Actor
-
def
preRestart(reason: Throwable, message: Option[Any]): Unit
- Definition Classes
- Actor
- Annotations
- @throws( classOf[java.lang.Exception] )
-
def
preStart(): Unit
- Definition Classes
- Actor
- Annotations
- @throws( classOf[java.lang.Exception] )
-
def
publicUrl(directory: String, devFile: String, prodFile: String): String
Ex: publicUrl("jquery/3.4.1/dist", "jquery.js", "jquery.min.js")
Ex: publicUrl("jquery/3.4.1/dist", "jquery.js", "jquery.min.js")
- directory
Relative to the "public" directory, without leading "/"
- devFile
File in the directory to use in development mode
- prodFile
File in the directory to use in production mode
- Definition Classes
- Url
-
def
publicUrl(devPath: String, prodPath: String): String
Ex: publicUrl("jquery/3.4.1/dist/jquery.js", "jquery/3.4.1/dist/jquery.min.js")
Ex: publicUrl("jquery/3.4.1/dist/jquery.js", "jquery/3.4.1/dist/jquery.min.js")
- devPath
File path to use in development mode, relative to the "public" directory, without leading "/"
- prodPath
File path to use in production mode, relative to the "public" directory, without leading "/"
- Definition Classes
- Url
-
def
publicUrl(path: String): String
Ex: publicUrl("jquery/3.4.1/dist/jquery.js")
Ex: publicUrl("jquery/3.4.1/dist/jquery.js")
- path
Relative to the "public" directory, without leading "/"
- Definition Classes
- Url
-
lazy val
queryParams: Params
Params after the question mark of the URL.
Params after the question mark of the URL. Ex: /search?q=xitrum
- Definition Classes
- RequestEnv
-
def
receive: Receive
- Definition Classes
- SockJsAction → Actor
-
def
redirectTo[T <: Action](params: (String, Any)*)(implicit arg0: Manifest[T]): ChannelFuture
Example: redirectTo[AnotherActionClass]()
Example: redirectTo[AnotherActionClass]()
Example: redirectTo[AnotherActionClass]("param1" -> value1, "param2" -> value2)
See also forwardTo.
- Definition Classes
- Redirect
-
def
redirectTo(location: String, status: HttpResponseStatus = HttpResponseStatus.FOUND): ChannelFuture
Example: redirectTo("https://google.com/"); status will be 302 FOUND
Example: redirectTo("https://google.com/"); status will be 302 FOUND
Example: redirectTo("https://google.com/", HttpResponseStatus.MOVED_PERMANENTLY)
See also forwardTo.
- Definition Classes
- Redirect
-
def
redirectToThis(params: (String, Any)*): ChannelFuture
Example: redirectToThis()
Example: redirectToThis()
Example: redirectToThis("param1" -> value1, "param2" -> value2)
Redirects back to the current action. See also forwardTo.
- Definition Classes
- Redirect
-
lazy val
remoteIp: String
- returns
IPv4 or IPv6 of the original remote HTTP client (not the proxy), X-Forwarded-For is supported
- Definition Classes
- Net
-
def
renderEventSource(data: Any, event: String = "message"): String
- Definition Classes
- Renderer
-
def
renderFragment[T <: Action](fragment: String)(implicit arg0: Manifest[T]): String
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
- Definition Classes
- ViewRenderer
-
def
renderFragment[T <: Action](fragment: String, options: Map[String, Any])(implicit arg0: Manifest[T]): String
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderFragment(actionClass: Class[_ <: Action], fragment: String): String
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
- Definition Classes
- ViewRenderer
-
def
renderFragment(actionClass: Class[_ <: Action], fragment: String, options: Map[String, Any]): String
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderFragment(directoryUri: String, fragment: String): String
Renders the template fragment at the directory.
Renders the template fragment at the directory.
- Definition Classes
- ViewRenderer
-
def
renderFragment(directoryUri: String, fragment: String, options: Map[String, Any]): String
Renders the template fragment at the directory.
Renders the template fragment at the directory.
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderInlineView(inlineView: Any): String
Sets renderedView and call layout.
Sets renderedView and call layout.
- Definition Classes
- ViewRenderer
-
def
renderTemplate(uri: String): String
Renders the template at
(renderedView is not affected).uri
Renders the template at
(renderedView is not affected).uri
- Definition Classes
- ViewRenderer
-
def
renderTemplate(uri: String, options: Map[String, Any]): String
Renders the template at
(renderedView is not affected).uri
Renders the template at
(renderedView is not affected).uri
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderView[T <: Action]()(implicit arg0: Manifest[T]): String
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
- Definition Classes
- ViewRenderer
-
def
renderView[T <: Action](options: Map[String, Any])(implicit arg0: Manifest[T]): String
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderView(actionClass: Class[_ <: Action]): String
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
- Definition Classes
- ViewRenderer
-
def
renderView(actionClass: Class[_ <: Action], options: Map[String, Any]): String
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderView[T <: Action](customLayout: () ⇒ Any)(implicit arg0: Manifest[T]): String
Renders the template associated with the action to renderedView, then calls the custom layout.
Renders the template associated with the action to renderedView, then calls the custom layout.
- Definition Classes
- ViewRenderer
-
def
renderView[T <: Action](customLayout: () ⇒ Any, options: Map[String, Any])(implicit arg0: Manifest[T]): String
Renders the template associated with the action to renderedView, then calls the custom layout.
Renders the template associated with the action to renderedView, then calls the custom layout.
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderView(customLayout: () ⇒ Any, actionClass: Class[_ <: Action]): String
Renders the template associated with the action to renderedView, then calls the custom layout.
Renders the template associated with the action to renderedView, then calls the custom layout.
- Definition Classes
- ViewRenderer
-
def
renderView(customLayout: () ⇒ Any, actionClass: Class[_ <: Action], options: Map[String, Any]): String
Renders the template associated with the action to renderedView, then calls the custom layout.
Renders the template associated with the action to renderedView, then calls the custom layout.
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderView(uri: String): String
Renders the template at
to renderedView, then calls layout.uri
Renders the template at
to renderedView, then calls layout.uri
- Definition Classes
- ViewRenderer
-
def
renderView(uri: String, options: Map[String, Any]): String
Renders the template at
to renderedView, then calls layout.uri
Renders the template at
to renderedView, then calls layout.uri
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderView(customLayout: () ⇒ Any, uri: String): String
Renders the template at
to renderedView, then calls the custom layout.uri
Renders the template at
to renderedView, then calls the custom layout.uri
- Definition Classes
- ViewRenderer
-
def
renderView(customLayout: () ⇒ Any, uri: String, options: Map[String, Any]): String
Renders the template at
to renderedView, then calls the custom layout.uri
Renders the template at
to renderedView, then calls the custom layout.uri
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderViewNoLayout[T <: Action]()(implicit arg0: Manifest[T]): String
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
- Definition Classes
- ViewRenderer
-
def
renderViewNoLayout[T <: Action](options: Map[String, Any])(implicit arg0: Manifest[T]): String
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderViewNoLayout(actionClass: Class[_ <: Action]): String
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
- Definition Classes
- ViewRenderer
-
def
renderViewNoLayout(actionClass: Class[_ <: Action], options: Map[String, Any]): String
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
def
renderViewNoLayout(uri: String): String
Renders the template at
to renderedView.uri
Renders the template at
to renderedView.uri
- Definition Classes
- ViewRenderer
-
def
renderViewNoLayout(uri: String, options: Map[String, Any]): String
Renders the template at
to renderedView.uri
Renders the template at
to renderedView.uri
- options
specific to the configured template engine
- Definition Classes
- ViewRenderer
-
val
renderedView: Any
- Definition Classes
- ViewRenderer
-
lazy val
request: FullHttpRequest
- Definition Classes
- RequestEnv
-
lazy val
requestContentJValue: JValue
The whole request body parsed as JSON4S JValue.
The whole request body parsed as JSON4S JValue. You can use SeriDeseri.fromJValue to convert this to Scala object (case class, Map, Seq etc.).
- Definition Classes
- RequestEnv
-
lazy val
requestContentString: String
The whole request body as String.
The whole request body as String.
- Definition Classes
- RequestEnv
-
lazy val
requestCookies: Map[String, String]
Browsers will not send cookie attributes back to the server.
Browsers will not send cookie attributes back to the server. They will only send the cookie (name-value pairs). http://en.wikipedia.org/wiki/HTTP_cookie#Cookie_attributes
- Definition Classes
- SessionEnv
-
def
respond(): ChannelFuture
- Definition Classes
- Responder
-
def
respond404Page(): Unit
- Definition Classes
- Responder
-
def
respond500Page(): Unit
- Definition Classes
- Responder
-
def
respondBinary(byteBuf: ByteBuf): ChannelFuture
If Content-Type header is not set, it is set to "application/octet-stream".
If Content-Type header is not set, it is set to "application/octet-stream".
- byteBuf
Will be released
- Definition Classes
- Responder
-
def
respondBinary(bytes: Array[Byte]): ChannelFuture
If Content-Type header is not set, it is set to "application/octet-stream".
If Content-Type header is not set, it is set to "application/octet-stream".
- Definition Classes
- Responder
-
def
respondDefault404Page(): ChannelFuture
- Definition Classes
- Responder
-
def
respondDefault500Page(): ChannelFuture
- Definition Classes
- Responder
-
def
respondEventSource(data: Any, event: String = "message"): ChannelFuture
To respond event source, call this method as many time as you want.
To respond event source, call this method as many time as you want. Event Source response is a special kind of chunked response, data must be UTF-8. See: - http://sockjs.github.com/sockjs-protocol/sockjs-protocol-0.3.3.html#section-94 - http://dev.w3.org/html5/eventsource/
No need to call setChunked() before calling this method.
- Definition Classes
- Responder
-
def
respondFile(path: String): ChannelFuture
Sends a file using X-SendFile.
Sends a file using X-SendFile. If Content-Type header is not set, it is guessed from the file name.
- path
absolute or relative to the current working directory In some cases, the current working directory is not always the root directory of the project (https://github.com/xitrum-framework/xitrum/issues/47), you may need to use xitrum.Config.root to calculate the correct absolute path from a relative path. To sanitize the path, use xitrum.util.PathSanitizer.
- Definition Classes
- Responder
-
def
respondHtml(any: Any): ChannelFuture
Content-Type header is set to "text/html".
Content-Type header is set to "text/html".
- Definition Classes
- Responder
-
def
respondInlineView(inlineView: Any): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondJs(any: Any): ChannelFuture
Content-Type header is set to "application/javascript".
Content-Type header is set to "application/javascript".
- Definition Classes
- Responder
-
def
respondJson(ref: AnyRef): ChannelFuture
Converts the given Scala object to JSON object, and responds it.
Converts the given Scala object to JSON object, and responds it. If you just want to respond a text with "application/json" as content type, use respondJsonText(text).
Content-Type header is set to "application/json". "text/json" would make the browser download instead of displaying the content. It makes debugging a pain.
- Definition Classes
- Responder
-
def
respondJsonP(ref: AnyRef, function: String): ChannelFuture
Converts the given Scala object to JSON object, wraps it with the given JavaScript function name, and responds.
Converts the given Scala object to JSON object, wraps it with the given JavaScript function name, and responds. If you already have a JSON text, thus no conversion is needed, use respondJsonPText.
Content-Type header is set to "application/javascript".
- Definition Classes
- Responder
-
def
respondJsonPText(text: Any, function: String): ChannelFuture
Wraps the text with the given JavaScript function name, and responds.
Wraps the text with the given JavaScript function name, and responds.
Content-Type header is set to "application/javascript".
- Definition Classes
- Responder
-
def
respondJsonText(any: Any): ChannelFuture
Content-Type header is set to "application/json".
Content-Type header is set to "application/json".
- Definition Classes
- Responder
-
def
respondLastChunk(trailingHeaders: HttpHeaders = EmptyHttpHeaders.INSTANCE): ChannelFuture
See setChunked.
See setChunked.
- Definition Classes
- Responder
-
def
respondResource(path: String): ChannelFuture
Sends a file from public directory in one of the entry (may be a JAR file) in classpath.
Sends a file from public directory in one of the entry (may be a JAR file) in classpath. If Content-Type header is not set, it is guessed from the file name.
- path
Relative to an entry in classpath, without leading "/"
- Definition Classes
- Responder
- def respondSockJsClose(): Future[Unit]
- def respondSockJsJson(scalaObject: AnyRef): Future[Unit]
- def respondSockJsText(text: String): Future[Unit]
-
def
respondTemplate(uri: String): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondTemplate(uri: String, options: Map[String, Any]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondText(text: Any, fallbackContentType: String = null, convertXmlToXhtml: Boolean = true): ChannelFuture
- fallbackContentType
Only used if Content-Type header has not been set. If not given and Content-Type header is not set, it is set to "application/xml" if text param is Node or NodeSeq, otherwise it is set to "text/plain".
- convertXmlToXhtml
.toString by default returns
which is rendered as 2
tags on some browsers! Set to false if you really want XML, not XHTML. See http://www.scala-lang.org/node/492 and http://www.ne.jp/asahi/hishidama/home/tech/scala/xml.html
- Definition Classes
- Responder
-
def
respondView[T <: Action]()(implicit arg0: Manifest[T]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView[T <: Action](options: Map[String, Any])(implicit arg0: Manifest[T]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView(actionClass: Class[_ <: Action]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView(actionClass: Class[_ <: Action], options: Map[String, Any]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView[T <: Action](customLayout: () ⇒ Any)(implicit arg0: Manifest[T]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView[T <: Action](customLayout: () ⇒ Any, options: Map[String, Any])(implicit arg0: Manifest[T]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView(customLayout: () ⇒ Any, actionClass: Class[_ <: Action]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView(customLayout: () ⇒ Any, actionClass: Class[_ <: Action], options: Map[String, Any]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView(uri: String): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView(uri: String, options: Map[String, Any]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView(customLayout: () ⇒ Any, uri: String): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondView(customLayout: () ⇒ Any, uri: String, options: Map[String, Any]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondViewNoLayout[T <: Action]()(implicit arg0: Manifest[T]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondViewNoLayout[T <: Action](options: Map[String, Any])(implicit arg0: Manifest[T]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondViewNoLayout(actionClass: Class[_ <: Action]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondViewNoLayout(actionClass: Class[_ <: Action], options: Map[String, Any]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondViewNoLayout(uri: String): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondViewNoLayout(uri: String, options: Map[String, Any]): ChannelFuture
- Definition Classes
- ViewResponder
-
def
respondXml(any: Any): ChannelFuture
Content-Type header is set to "application/xml".
Content-Type header is set to "application/xml".
- Definition Classes
- Responder
-
lazy val
response: FullHttpResponse
- Definition Classes
- RequestEnv
-
lazy val
responseCookies: ArrayBuffer[Cookie]
- Definition Classes
- SessionEnv
-
lazy val
scheme: String
- Definition Classes
- Net
-
implicit final
val
self: ActorRef
- Definition Classes
- Actor
-
final
def
sender(): ActorRef
- Definition Classes
- Actor
-
lazy val
serverName: String
- Definition Classes
- Net
-
lazy val
serverPort: Int
- Definition Classes
- Net
-
lazy val
session: Map[String, Any]
To reset session: session.clear()
To reset session: session.clear()
- Definition Classes
- SessionEnv
-
def
sessiono[T](key: String)(implicit d: DefaultsTo[T, String]): Option[T]
- Definition Classes
- SessionEnv
-
def
setChunked(): Unit
To respond chunks (http://en.wikipedia.org/wiki/Chunked_transfer_encoding): 1.
To respond chunks (http://en.wikipedia.org/wiki/Chunked_transfer_encoding): 1. Call setChunked() to mark that the response will be chunked 2. Call respondXXX as normal, but as many times as you want 3. Lastly, call respondLastChunk()
If Content-Type header is not set, it is set to "application/octet-stream".
- Definition Classes
- Responder
-
def
setClientCacheAggressively(): Unit
Tells the browser to cache static files for a long time.
Tells the browser to cache static files for a long time. This works well even when this is a cluster of web servers behind a load balancer because the URL created by urlForResource is in the form: resource?etag
Don't worry that browsers do not pick up new files after you modified them, see the doc about static files.
Google recommends 1 year: http://code.google.com/speed/page-speed/docs/caching.html
Both Max-age and Expires header are set because IEs use Expires, not max-age: http://mrcoles.com/blog/cookies-max-age-vs-expires/
- Definition Classes
- Responder
-
def
setCookieAndSessionIfTouchedOnRespond(): Unit
- Definition Classes
- SessionEnv
-
def
setNoClientCache(): Unit
Prevents client cache.
Prevents client cache. Note that "pragma: no-cache" is linked to requests, not responses: http://palizine.plynt.com/issues/2008Jul/cache-control-attributes/
- Definition Classes
- Responder
-
def
sockJsUrl[T <: SockJsAction](implicit arg0: Manifest[T]): String
- Definition Classes
- Url
-
def
supervisorStrategy: SupervisorStrategy
- Definition Classes
- Actor
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
t(singular: String, args: Any*): String
formatLocal
using the current locale.formatLocal
using the current locale.- Definition Classes
- I18n
-
def
t(singular: String): String
- Definition Classes
- I18n
-
def
tc(ctx: String, singular: String, args: Any*): String
formatLocal
using the current locale.formatLocal
using the current locale.- Definition Classes
- I18n
-
def
tc(ctx: String, singular: String): String
- Definition Classes
- I18n
-
def
tcn(ctx: String, singular: String, plural: String, n: Long, args: Any*): String
formatLocal
using the current locale.formatLocal
using the current locale.- Definition Classes
- I18n
-
def
tcn(ctx: String, singular: String, plural: String, n: Long): String
- Definition Classes
- I18n
-
lazy val
textParams: Params
The merge of all text params (queryParams, bodyParams, and pathParams), as contrast to file upload (bodyFileParams).
The merge of all text params (queryParams, bodyParams, and pathParams), as contrast to file upload (bodyFileParams).
- Definition Classes
- RequestEnv
-
implicit
val
timeout: FiniteDuration
Convenient implicit, for example for use when you use scala.concurrent.Await.
Convenient implicit, for example for use when you use scala.concurrent.Await.
- Definition Classes
- Action
-
def
tn(singular: String, plural: String, n: Long, args: Any*): String
formatLocal
using the current locale.formatLocal
using the current locale.- Definition Classes
- I18n
-
def
tn(singular: String, plural: String, n: Long): String
- Definition Classes
- I18n
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unhandled(message: Any): Unit
- Definition Classes
- Actor
-
def
url[T <: Action](implicit arg0: Manifest[T]): String
- Definition Classes
- Url
-
def
url[T <: Action](params: (String, Any)*)(implicit arg0: Manifest[T]): String
- Definition Classes
- Url
-
def
url(params: (String, Any)*): String
- Definition Classes
- Url
-
lazy val
url: String
- Definition Classes
- Url
-
lazy val
urlParams: Params
The merge of queryParams and pathParams, things that appear in the request URL.
The merge of queryParams and pathParams, things that appear in the request URL.
- Definition Classes
- RequestEnv
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
webJarsUrl(directory: String, devFile: String, prodFile: String): String
Ex: webJarsUrl("jquery/3.4.1/dist", "jquery.js", "jquery.min.js")
Ex: webJarsUrl("jquery/3.4.1/dist", "jquery.js", "jquery.min.js")
- devFile
File in the directory to use in development mode
- prodFile
File in the directory to use in production mode
- Definition Classes
- Url
-
def
webJarsUrl(devPath: String, prodPath: String): String
Ex: webJarsUrl("jquery/3.4.1/dist/jquery.js", "jquery/3.4.1/dist/jquery.min.js")
Ex: webJarsUrl("jquery/3.4.1/dist/jquery.js", "jquery/3.4.1/dist/jquery.min.js")
- devPath
File path to use in development mode
- prodPath
File path to use in production mode
- Definition Classes
- Url
-
def
webJarsUrl(path: String): String
- path
Use "myapp/foo.js" to specify "META-INF/resources/webjars/myapp/foo.js"
- Definition Classes
- Url
-
lazy val
webSocketScheme: String
- Definition Classes
- Net
-
lazy val
xitrumCss: Node
- Definition Classes
- FlashRenderer