In the websocket entry point action, call this method if you want to accept the connection.
In the websocket entry point action, call this method if you want to accept the connection.
If there's no suitable language, language is still the default "en".
If there's no suitable language, language is still the default "en".
f takes username and password, and returns true if it want to let the user in.
f takes username and password, and returns true if it want to let the user in.
List of languages sorted by priority from high to low
Called by Dispatcher
Called by Dispatcher
Called by Dispatcher
Called by Dispatcher
Called by Dispatcher
Called by Dispatcher
Applications may override this method to convert to more types.
Applications may override this method to convert to more types.
You can write: if (currentController == MyController) .
You can write: if (currentController == MyController) ...
Creates route for 404 or 500 error handler.
Creates route for 404 or 500 error handler.
Returns the current content in flash, and clears the flash.
Returns the current content in flash, and clears the flash.
jsFlash(msg).
Tells another action to process the current request for the current action.
Tells another action to process the current request for the current action. See also redirectTo.
Set to true by forwardTo.
Set to true by forwardTo.
Default language is "en".
Default language is "en".
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.
See http://stackoverflow.
See http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery
Like jsRenderFlash(msg), but uses the current flash.
Like jsRenderFlash(msg), but uses the current flash.
For web 2.
For web 2.0 style application. Used in application layout to display the flash message right after a view is loaded.
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.
Logger name is inferred from the class name.
Logger name is inferred from the class name.
See also forwardTo.
See also forwardTo.
See also forwardTo.
See also forwardTo.
IP of the original remote HTTP client (not the proxy), X-Forwarded-For is supported
Renders the fragment associated with the current controller class.
Renders the fragment associated with the current controller class.
Renders the template fragment inside the directory associated with the controller class.
Renders the template fragment inside the directory associated with the controller class.
should be one of the parent classes of the current controller because the current controller instance will be imported in the template as "helper"
specific to the configured template engine
Same as renderView(action, customLayout, options), where action is currentAction and customLayout is the current controller's layout method.
Same as renderView(action, customLayout, options), where action is currentAction and customLayout is the current controller's layout method.
Same as renderView(action, customLayout, options), where customLayout is the current controller's layout method.
Same as renderView(action, customLayout, options), where customLayout is the current controller's layout method.
Same as renderView(action, customLayout, options), where action is currentAction.
Same as renderView(action, customLayout, options), where action is currentAction.
Renders the template associated with an action to "renderedTemplate", then calls the layout function.
Renders the template associated with an action to "renderedTemplate", then calls the layout function.
specific to the configured template engine
Renders the template (typically the layout) associated with the controller class.
Renders the template (typically the layout) associated with the controller class.
should be one of the parent classes of the current controller because the current controller instance will be imported in the template as "helper"
specific to the configured template engine
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’s name-value pair. http://en.wikipedia.org/wiki/HTTP_cookie#Cookie_attributes
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"
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"
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/
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.
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.
Content-Type header is set to "text/html".
Content-Type header is set to "text/html".
Content-Type header is set to "text/html"
Content-Type header is set to "text/html"
Content-Type header is set to "application/javascript".
Content-Type header is set to "application/javascript".
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.
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".
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".
Content-Type header is set to "application/json".
Content-Type header is set to "application/json".
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.
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.
Relative to an entry in classpath, without leading "/"
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".
.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
Same as respondView(action, customLayout, options), where action is currentAction and customLayout is the controller's layout method.
Same as respondView(action, customLayout, options), where action is currentAction and customLayout is the controller's layout method.
Same as respondView(action, customLayout, options), where customLayout is the controller's layout method.
Same as respondView(action, customLayout, options), where customLayout is the controller's layout method.
Same as respondView(action, customLayout, options), where action is currentAction.
Same as respondView(action, customLayout, options), where action is currentAction.
specific to the configured template engine
Content-Type header is set to "text/html"
Content-Type header is set to "text/html"
Content-Type header is set to "application/xml".
Content-Type header is set to "application/xml".
To reset session: session.
To reset session: session.clear()
A merge of all text params (uriParams, bodyParams, pathParams), as contrast to file upload (fileParams).
A merge of all text params (uriParams, bodyParams, pathParams), as contrast to file upload (fileParams).
A val not a def, for speed, so that the calculation is done only once.
lazy, so that bodyParams can be changed by ValidatorCaller. Because this is a val, once this is accessed, either of the 3 params should not be changed, because the change will not be reflected. If you still want to change the the 3 params, after changing them, please also change this textParams.
Relative to the "public" directory, without leading "/"
Relative to an entry in classpath, without leading "/"