xitrum.view

Responder

trait Responder extends JS with Flash with Knockout

When responding text, charset is automatically set, as advised by Google: http://code.google.com/speed/page-speed/docs/rendering.html#SpecifyCharsetEarly

Self Type
Action
Linear Supertypes
Knockout, Flash, JS, AnyRef, Any
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Responder
  2. Knockout
  3. Flash
  4. JS
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. 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
    Flash
  12. def flash(msg: Any): Unit

    Definition Classes
    Flash
    See also

    jsFlash(msg).

  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. lazy val isAjax: Boolean

    Definition Classes
    JS
  16. def isDoneResponding: Boolean

  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. def js$(selector: String): String

    Definition Classes
    JS
  19. def js$id(id: String): String

    Definition Classes
    JS
  20. def js$name(name: String): String

    Definition Classes
    JS
  21. def jsAddToView(js: Any): Unit

    Definition Classes
    JS
  22. lazy val jsDefaults: Group

    Definition Classes
    JS
  23. 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 JSON4S or xitrum.util.Json, e.g xitrum.util.Json.generate(Seq(string)).

    org.apache.commons.lang3.StringEscapeUtils is used internally.

    Definition Classes
    JS
  24. lazy val jsForView: Serializable

    Definition Classes
    JS
  25. def jsRedirectTo[T <: Action](params: (String, Any)*)(implicit arg0: Manifest[T]): ChannelFuture

    Definition Classes
    JS
  26. def jsRedirectTo(location: Any): ChannelFuture

    See http://stackoverflow.

    See http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery

    Definition Classes
    JS
  27. def jsRenderFlash(): Unit

    Like jsRenderFlash(msg), but uses the current flash.

    Like jsRenderFlash(msg), but uses the current flash.

    Definition Classes
    Flash
  28. def jsRenderFlash(msg: Any): Unit

    For web 2.

    For web 2.0 style application. Used in application layout to display the flash message right after a view is loaded.

    Definition Classes
    Flash
  29. def jsRespond(fragments: Any*): ChannelFuture

    Definition Classes
    JS
  30. def jsRespondFlash(msg: Any): Unit

    For web 2.

    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
    Flash
  31. def koApplyBindingsCs(model: AnyRef, scopeSelector: String, syncActionClass: Class[_ <: Action], cs: String): Unit

    Definition Classes
    Knockout
  32. def koApplyBindingsCs(model: AnyRef, syncActionClass: Class[_ <: Action], cs: String): Unit

    Definition Classes
    Knockout
  33. def koApplyBindingsJs(model: AnyRef, scopeSelector: String, syncActionClass: Class[_ <: Action], js: String): Unit

    Definition Classes
    Knockout
  34. def koApplyBindingsJs(model: AnyRef, syncActionClass: Class[_ <: Action], js: String): Unit

    Definition Classes
    Knockout
  35. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  38. def onDoneResponding(): Unit

    Called when the response or the last chunk (in case of chunked response) has been sent to the client.

  39. def respond(): ChannelFuture

  40. def respondBinary(channelBuffer: ChannelBuffer): ChannelFuture

    If Content-Type header is not set, it is set to "application/octet-stream"

  41. def respondBinary(bytes: Array[Byte]): ChannelFuture

    If Content-Type header is not set, it is set to "application/octet-stream"

  42. def respondDefault404Page(): ChannelFuture

  43. def respondDefault500Page(): ChannelFuture

  44. 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 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/

  45. 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/ngocdaothanh/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.

  46. def respondHtml(any: Any): ChannelFuture

    Content-Type header is set to "text/html".

  47. def respondInlineView(inlineView: Any): ChannelFuture

    Content-Type header is set to "text/html"

  48. def respondJs(any: Any): ChannelFuture

    Content-Type header is set to "application/javascript".

  49. def respondJson(obj: 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.

  50. def respondJsonP(obj: 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".

  51. 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".

  52. def respondJsonText(any: Any): ChannelFuture

    Content-Type header is set to "application/json".

  53. def respondLastChunk(): ChannelFuture

    To respond chunks (http://en.

    To respond chunks (http://en.wikipedia.org/wiki/Chunked_transfer_encoding): 1. Call response.setChunked(true) 2. Call respondXXX as many times as you want 3. Lastly, call respondLastChunk()

    Headers are only sent on the first respondXXX call.

  54. 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 "/"

  55. 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

  56. def respondView(): ChannelFuture

  57. def respondView(options: Map[String, Any]): ChannelFuture

  58. def respondView(location: Class[_ <: Action]): ChannelFuture

  59. def respondView(customLayout: () ⇒ Any): ChannelFuture

  60. def respondView(customLayout: () ⇒ Any, location: Class[_ <: Action]): ChannelFuture

  61. def respondView(customLayout: () ⇒ Any, options: Map[String, Any]): ChannelFuture

  62. def respondView(location: Class[_ <: Action], options: Map[String, Any]): ChannelFuture

  63. def respondView(customLayout: () ⇒ Any, location: Class[_ <: Action], options: Map[String, Any]): ChannelFuture

    options

    specific to the configured template engine

  64. def respondViewNoLayout(): ChannelFuture

  65. def respondViewNoLayout(options: Map[String, Any]): ChannelFuture

  66. def respondViewNoLayout(location: Class[_ <: Action]): ChannelFuture

  67. def respondViewNoLayout(location: Class[_ <: Action], options: Map[String, Any]): ChannelFuture

    Content-Type header is set to "text/html"

  68. def respondXml(any: Any): ChannelFuture

    Content-Type header is set to "application/xml".

  69. def setClientCacheAggressively(): Unit

  70. def setNoClientCache(): Unit

  71. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  72. def toString(): String

    Definition Classes
    AnyRef → Any
  73. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  74. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  75. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  76. lazy val xitrumCSS: String

    Definition Classes
    Flash

Inherited from Knockout

Inherited from Flash

Inherited from JS

Inherited from AnyRef

Inherited from Any

Ungrouped