Skip to content

Instantly share code, notes, and snippets.

View jstrachan's full-sized avatar

James Strachan jstrachan

View GitHub Profile
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scalaVersion}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scalaVersion}</version>
</dependency>
import scala.util.parsing.combinator._
import java.io.Reader
abstract class OutputLine {
def text: String
}
case class TextLine(text: String) extends OutputLine {}
case class LogLine(level: String, line: OutputLine) extends OutputLine {
class MyTemplates {
@template("foo.ssp")
def cheese(arg1: Arg1, arg2: Arg2) : Unit
}
@templateDir("/foo/bar", ext=".ssp")
class MyTemplates {
Loading page: http://localhost:58592/ssp/renderObject.ssp
java.lang.InstantiationException: org.fusesource.scalate.sample.$_scalate_$Person_index_ssp
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
at org.fusesource.scalate.TemplateEngine.createTemplate(TemplateEngine.scala:175)
at org.fusesource.scalate.TemplateEngine.preparePage(TemplateEngine.scala:163)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:79)
at org.fusesource.scalate.servlet.TemplateEngineServlet.service(TemplateEngineServlet.scala:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
value match {
case n: Node => out.print(n)
case s: Seq[Node] => for (n <- s) {out.print(n)}
case a => write(XmlEscape.escape(toString(a)))
}
/* NOTE this file is autogenerated by Scalate : see http://scalate.fusesource.org/ */
package Application
object $_scalate_$index_ssp{
def $_scalate_$render($_scalate_$_context:_root_.org.fusesource.scalate.RenderContext): Unit = {
val context:org.fusesource.scalate.DefaultRenderContext = ($_scalate_$_context.attributes.get("context") match {
case None => { throw new _root_.org.fusesource.scalate.NoValueSetException("context") }
case Some(null) => { throw new _root_.org.fusesource.scalate.NoValueSetException("context") }
case Some(value) => { value.asInstanceOf[org.fusesource.scalate.DefaultRenderContext] }
});
public abstract class PersonFormModelSupport extends Composite {
@UiField
FieldModel<Boolean> likesCheese = fieldOfType(Boolean.class).boundTo(someBean, "cheeseLover");
@UiField
FieldModel<String> whyILikeCheese = fieldOfType(String.class).boundTo(someBean, "reasonForLi
}
<%@ val type: Class %>
\<%@ val it: ${type.getName%} %>
<table>
<% for (property <- introspect(type)) { %>
<tr>
<td>${property.label}</td>
<td>\${it.${property.name}}</td>
</tr>
<%}%>
</table>
<table class="person">
<tr>
<td>
<label>last</label>
</td>
<td class="value">
${it.last}
</td>
</tr>
-@ import val it: Console
%h2 Scalate Console
%ul
%li create view
%li templates: #{templates}
%li resource: #{resource}
- if (templates != null)