Created
May 28, 2012 15:37
-
-
Save fordguo/2819770 to your computer and use it in GitHub Desktop.
gsp template render
This file contains 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 out = new org.codehaus.groovy.grails.web.pages.FastStringWriter() | |
def test1Instance = new Test1(prop2: "This is gsp test") | |
long startTime = System.currentTimeMillis() | |
def t=groovyPagesTemplateEngine.createTemplate(gspTemplateCode, 'gspTemplate') | |
for (int i = 0; i < TIMES; i++) { | |
t.make([test1Instance: test1Instance]).writeTo(out) | |
out.flush() | |
println "Executing... $i" | |
} | |
response.setContentType("text/json;charset=UTF-8") | |
long timeTaken = System.currentTimeMillis() - startTime | |
render '{"message":"' + TIMES + ' times completed in ' + timeTaken + 'ms."}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment