/ Published in: Groovy
this example is based on http://groovy.codehaus.org/Grape
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// this example is based on http://groovy.codehaus.org/Grape import org.mortbay.jetty.Server import org.mortbay.jetty.servlet.* import groovy.servlet.* @Grab(group = 'org.mortbay.jetty', module = 'jetty-embedded', version = '6.1.0') context.resourceBase = "." context.addServlet(DefaultServlet, "/") context.addServlet(TemplateServlet, "*.gsp") // /* WebAppContext webapp = new WebAppContext(); webapp.setContextPath("/"); webapp.setWar("http-server-0.9-SNAPSHOT"); server.setHandler(webapp); */ // //sleep duration println "Press enter or return to stop web server." server.stop() } runServer()
URL: http://groovy.codehaus.org/Grape