- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Scala Server Pages
Wed, 2009-03-25, 20:04
Hello,
FYI, I am finishing up an implementation of support for Scala Server
Pages -- like JSPs, but for Scala instead of Java. If anyone is
interested, just let me know and I'll make the source available.
There is no support for tag libraries, EL, or anything like JSTL, but
it does support basics such as <%...%>, <%=...%>, recompilation when
the .ssp source changes, etc.. There is also a lightweight syntax for
HTML-/XML-escaping output: ${__} is equivalent to <%=__%>, except
that __ is HTML-escaped before being output, much like in JSTL but shorter thanks to
hijacking the otherwise unused EL syntax and a bit more flexible
because __ can be any Scala expression.
There are definite rough spots, but it works and is sufficient for my
purposes. (Or, rather, it will be as soon as I finish up the last few
items on my 'to do' list.)
Best,
-Matt
Wed, 2009-03-25, 21:47
#2
Re: Scala Server Pages
Matt Hildebrand writes:
> If anyone is
> interested, just let me know and I'll make the source available.
Interested. Definitely worth to be an opensource project.
Wed, 2009-03-25, 22:37
#3
Re: Scala Server Pages
FWIW, I'm using FreeMarker with Scala and loving the combination.
FreeMarker has very strong separation between presentation of the data
(in freemarker markup) and logic and the exposing of the presentation
data model (in Java or in my case Scala).
http://www.freemarker.org/features.html
-Tupshin
Matt Hildebrand wrote:
> Hello,
>
> FYI, I am finishing up an implementation of support for Scala Server
> Pages -- like JSPs, but for Scala instead of Java. If anyone is
> interested, just let me know and I'll make the source available.
>
> There is no support for tag libraries, EL, or anything like JSTL, but
> it does support basics such as <%...%>, <%=...%>, recompilation when
> the .ssp source changes, etc.. There is also a lightweight syntax for
> HTML-/XML-escaping output: ${__} is equivalent to <%=__%>, except
> that __ is HTML-escaped before being output, much like value="${__}" escapeXml="true"/> in JSTL but shorter thanks to
> hijacking the otherwise unused EL syntax and a bit more flexible
> because __ can be any Scala expression.
>
> There are definite rough spots, but it works and is sufficient for my
> purposes. (Or, rather, it will be as soon as I finish up the last few
> items on my 'to do' list.)
>
> Best,
> -Matt
>
Thu, 2009-03-26, 00:07
#4
Re: Scala Server Pages
Tupshin Harper writes:
> FWIW, I'm using FreeMarker with Scala and loving the combination.
> FreeMarker has very strong separation between presentation of the data
> (in freemarker markup) and logic and the exposing of the presentation
> data model (in Java or in my case Scala).
> http://www.freemarker.org/features.html
>
> -Tupshin
There's also ZipScript: http://code.google.com/p/zipscript/
Fri, 2009-03-27, 00:37
#5
Re: Re: Scala Server Pages
>> If anyone is
>> interested, just let me know and I'll make the source available.
>
> Interested. Definitely worth to be an opensource project.
Ok, it's now available here:
http://github.com/matthild/serverpages/tree/master
There's a readme file that gives some instructions & commentary.
This project isn't a priority for me -- I put it together quickly over
the last few days while learning Scala, and am now turning to other
projects -- but if anyone has a use for something similar, you're
certainly welcome to use it. It's distributed under the permissive
ISC license (similar to a two-clause BSD license).
Best,
-Matt
On Wednesday March 25 2009, Matt Hildebrand wrote:
> Hello,
>
> FYI, I am finishing up an implementation of support for Scala Server
> Pages -- like JSPs, but for Scala instead of Java. If anyone is
> interested, just let me know and I'll make the source available.
Are you familiar with Google XML Pages? If so, how does your SSP
compare? I thought of it because it has some functional aspects. In
particular, there's strong typing of templates and values used within
the templates and side-effects are discouraged. There are slides
describing it.
-
(redirects to the previous URL)
(slides from OSCON 2008)
> ...
>
> Best,
> -Matt
Randall Schulz