Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seratch/scalatra-thymeleaf-support
Scalatra Thymeleaf Support
https://github.com/seratch/scalatra-thymeleaf-support
Last synced: about 1 month ago
JSON representation
Scalatra Thymeleaf Support
- Host: GitHub
- URL: https://github.com/seratch/scalatra-thymeleaf-support
- Owner: seratch
- Created: 2012-07-09T07:30:31.000Z (over 12 years ago)
- Default Branch: 2.0.x
- Last Pushed: 2013-03-29T11:13:28.000Z (over 11 years ago)
- Last Synced: 2024-08-25T00:53:11.991Z (3 months ago)
- Language: Scala
- Size: 218 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scalatra Thymeleaf Support
This is an extension to Scalatra which enables to use Thymeleaf as Scalatra template engine instead of Scalate.
## Scalatra
Scalatra is a tiny, Sinatra-like web framework for Scala. Here are some contributed extensions to the library.
https://github.com/scalatra/scalatra
## Thymeleaf
Thymeleaf is a Java library. It is an XML / XHTML / HTML5 template engine (extensible to other formats) that can work both in web and non-web environments. It is better suited for serving XHTML/HTML5 at the view layer of web applications, but it can process any XML file even in offline environments.
http://thymeleaf.org
## How to use
Added library dependency to sbt settings.
```scala
"com.github.seratch" %% "scalatra-thymeleaf-support" % "2.0.2"
```And then mix ThymeleafSupport to ScalatraServlet/ScalatraFilter.
```scala
import scalatraext.thymeleaf.ThymeleafSupportclass MyServlet extends ScalatraServlet with ThymeleafSupport {
get("/") {
render("index", // webapp/WEB-INF/layouts/index.html
"name" -> "Alice",
"items" -> Seq(1,2,3)
"data" -> Map("foo" -> "bar")
)
}}
```## License
Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0.html