If there's no suitable language, language is still the default "en".
If there's no suitable language, language is still the default "en".
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
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
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.
takes username and password, returns true if it want to let the user in.
Adds a before filter.
Adds a before filter.
File params in request body.
File params in request body.
Params in request body.
Params in request body.
List of languages sorted by priority from high to low
Called by Dispatcher.
Called by Dispatcher. Calls all after filters.
Called by Dispatcher.
Called by Dispatcher. Calls all before filters until a filter has responded something.
false if a before filter has responded something and later before filters and the action's "execute" method should not be called
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.
This is convenient, for example, when you want to get the current action in view templates.
This is convenient, for example, when you want to get the current action in view templates.
Called when the HTTP request comes in.
Called when the HTTP request comes in. Actions have to implement this method.
This is convenient, for example, when you use scala.concurrent.Future.
This is convenient, for example, when you use scala.concurrent.Future.
Returns the current content in flash, and clears the flash.
Returns the current content in flash, and clears the flash.
jsFlash(msg).
Example: forwardTo[AnotherActionClass]()
Example: forwardTo[AnotherActionClass]()
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.
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.
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.
See jsAddToView.
See jsAddToView.
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
Like jsRenderFlash(msg), but uses the current flash.
Like jsRenderFlash(msg), but uses the current flash.
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.
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.
Default language is "en".
Default language is "en".
Sets current language.
Sets current language. There should be i18n/lang.po file in classpath.
Log name is inferred from name of the class extending this trait.
Log name is inferred from name of the class extending this trait.
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.
Params embedded in the path.
Params embedded in the path. Ex: /articles/:id
Ex: publicUrl("jquery/3.1.0/dist", "jquery.js", "jquery.min.js")
Ex: publicUrl("jquery/3.1.0/dist", "jquery.js", "jquery.min.js")
Relative to the "public" directory, without leading "/"
File in the directory to use in development mode
File in the directory to use in production mode
Ex: publicUrl("jquery/3.1.0/dist/jquery.js", "jquery/3.1.0/dist/jquery.min.js")
Ex: publicUrl("jquery/3.1.0/dist/jquery.js", "jquery/3.1.0/dist/jquery.min.js")
File path to use in development mode, relative to the "public" directory, without leading "/"
File path to use in production mode, relative to the "public" directory, without leading "/"
Ex: publicUrl("jquery/3.1.0/dist/jquery.js")
Ex: publicUrl("jquery/3.1.0/dist/jquery.js")
Relative to the "public" directory, without leading "/"
Params after the question mark of the URL.
Params after the question mark of the URL. Ex: /search?q=xitrum
Example: redirectTo[AnotherActionClass]()
Example: redirectTo[AnotherActionClass]()
Example: redirectTo[AnotherActionClass]("param1" -> value1, "param2" -> value2)
See also forwardTo.
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.
Example: redirectToThis()
Example: redirectToThis()
Example: redirectToThis("param1" -> value1, "param2" -> value2)
Redirects back to the current action. See also forwardTo.
IPv4 or IPv6 of the original remote HTTP client (not the proxy), X-Forwarded-For is supported
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
specific to the configured template engine
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
Renders the template fragment at the directory associated with the action.
specific to the configured template engine
Renders the template fragment at the directory.
Renders the template fragment at the directory.
Renders the template fragment at the directory.
Renders the template fragment at the directory.
specific to the configured template engine
Sets renderedView and call layout.
Sets renderedView and call layout.
Renders the template at
(renderedView is not affected).uri
Renders the template at
(renderedView is not affected).
uri
Renders the template at
(renderedView is not affected).uri
Renders the template at
(renderedView is not affected).
uri
specific to the configured template engine
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
specific to the configured template engine
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
Renders the template associated with the action to renderedView, then calls layout.
specific to the configured template engine
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.
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.
specific to the configured template engine
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.
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.
specific to the configured template engine
Renders the template at
to renderedView, then calls layout.uri
Renders the template at
to renderedView, then calls layout.
uri
Renders the template at
to renderedView, then calls layout.uri
Renders the template at
to renderedView, then calls layout.
uri
specific to the configured template engine
Renders the template at
to renderedView, then calls the custom layout.uri
Renders the template at
to renderedView, then calls the custom layout.
uri
Renders the template at
to renderedView, then calls the custom layout.uri
Renders the template at
to renderedView, then calls the custom layout.
uri
specific to the configured template engine
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
specific to the configured template engine
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
Renders the template associated with the action to renderedView.
specific to the configured template engine
Renders the template at
to renderedView.uri
Renders the template at
to renderedView.
uri
Renders the template at
to renderedView.uri
Renders the template at
to renderedView.
uri
specific to the configured template engine
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.).
The whole request body as String.
The whole request body as 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
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".
Will be released
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 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.
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/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.
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".
See setChunked.
See setChunked.
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
Content-Type header is set to "application/xml".
Content-Type header is set to "application/xml".
To reset session: session.clear()
To reset session: session.clear()
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".
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/
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/
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).
This is convenient, for example, when you use scala.concurrent.Await.
This is convenient, for example, when you use scala.concurrent.Await.
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.
Ex: webJarsUrl("jquery/3.1.0/dist", "jquery.js", "jquery.min.js")
Ex: webJarsUrl("jquery/3.1.0/dist", "jquery.js", "jquery.min.js")
File in the directory to use in development mode
File in the directory to use in production mode
Ex: webJarsUrl("jquery/3.1.0/dist/jquery.js", "jquery/3.1.0/dist/jquery.min.js")
Ex: webJarsUrl("jquery/3.1.0/dist/jquery.js", "jquery/3.1.0/dist/jquery.min.js")
File path to use in development mode
File path to use in production mode
Use "myapp/foo.js" to specify "META-INF/resources/webjars/myapp/foo.js"
Default metrics viewer page. This page could be overwritten in user application with any style.