Created
April 4, 2010 13:39
-
-
Save virasak/355401 to your computer and use it in GitHub Desktop.
Run webapp project from webapp directory
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
define "myproject" do | |
desc 'Run application with embedded jetty' | |
task :run => :compile do | |
Java::Commands.java('MyServer', :classpath => compile.dependencies + [compile.target.to_s]) | |
end | |
end |
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.mortbay.jetty._ | |
import org.mortbay.jetty.webapp.WebAppContext | |
object MyServer { | |
def main(args: Array[String]) = { | |
val server = new Server(8080) | |
val webAppContext = new WebAppContext("src/main/webapp", "/") | |
webAppContext.setConfigurationClasses(Array[String]( | |
"org.mortbay.jetty.webapp.WebInfConfiguration", | |
"org.mortbay.jetty.webapp.WebXmlConfiguration" | |
)) | |
server.addHandler(webAppContext) | |
server.start | |
server.join | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment