This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override def around(request: Request, response: Response)(controller: (Request, Response) => Unit) = { | |
super.around(request, response){ | |
(x: Request, y: Response) => { | |
//do authentication here | |
controller(x,y) | |
//do any cleanup work here | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getAbsoluteResource(path: String)(op: InputStream => Any) = {..} | |
def someInputStreamFunction(io: InputStream): Unit = {..} | |
// call the function: | |
getAbsoluteResource("/myPath.properties")(someInputStreamFunction) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
transaction{ | |
..your code within the transaction/persistence context goes here.. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def someFunction(identifiable: {def id: Long}){ | |
..do stuff.. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Applications/scala/sbt/sbt: line 1: 83468 Segmentation fault java -XX:+CMSClassUnloadingEnabled -Xmx1024M -Xss2M -XX:MaxPermSize=384m -noverify -javaagent:/Applications/ZeroTurnaround/JRebel/jrebel.jar -jar `dirname $0`/sbt-launch-0.7.5.RC0.jar "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[info] [total in 6624ms] | |
model contains 0 documentable templates | |
[info] [loaded package loader ch in 0ms] | |
[info] [loaded package loader epfl in 0ms] | |
[info] [loaded package loader lamp in 1ms] | |
[info] [loaded package loader util in 0ms] | |
[info] [loaded package loader fjbg in 1ms] | |
[info] [loaded package loader compiler in 0ms] | |
[info] [loaded package loader msil in 0ms] | |
[info] [loaded package loader emit in 0ms] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.bowlerframework.view.scalate.ComponentRenderSupport | |
import com.recursivity.jpa.Jpa._ | |
import collection.mutable.MutableList | |
/** | |
* Created by IntelliJ IDEA. | |
* User: wfaler | |
* Date: 20/02/2011 | |
* Time: 23:40 | |
* To change this template use File | Settings | File Templates. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ val makes: List[org.bowlerframework.examples.jpa.Make] %> | |
<%@ val make: org.bowlerframework.examples.jpa.Make %> | |
<select name="car.make"> | |
<% | |
makes.foreach(m => { | |
%> | |
<option <% if(make.id == m.id){%>SELECTED<%}%> id="${m.id}">${m}</option> | |
<% | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// register a default validator for "Car" model objects | |
ModelValidatorBuilder.registerValidatorBuilder(classOf[Car], new CarValidatorBuilder) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CarValidatorBuilder extends ModelValidatorBuilder[Car]{ | |
def initialize(bean: Car): ModelValidator = { | |
val builder = new DefaultModelValidator(classOf[Car]) | |
builder.add(MinLength("model", 3, {bean.model})) | |
return builder | |
} | |
} |