Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object WebMain extends App {
- import org.eclipse.jetty.server.Server
- import org.eclipse.jetty.annotations.AnnotationConfiguration
- import org.eclipse.jetty.plus.webapp.{ EnvConfiguration, PlusConfiguration }
- import org.eclipse.jetty.webapp.{
- WebAppContext, Configuration, FragmentConfiguration, JettyWebXmlConfiguration, MetaInfConfiguration,
- TagLibConfiguration, WebInfConfiguration, WebXmlConfiguration }
- val webappPath = "Personality.UI/src/main/webapp"
- val server = new Server(8080)
- val context = new WebAppContext
- context.setResourceBase(webappPath)
- context.setResourceBase(webappPath)
- context.setDescriptor(webappPath + "/WEB-INF/web.xml")
- context.setConfigurations(Array[Configuration](
- new AnnotationConfiguration,
- new WebInfConfiguration,
- new WebXmlConfiguration,
- new MetaInfConfiguration,
- new FragmentConfiguration,
- new EnvConfiguration,
- new PlusConfiguration,
- new JettyWebXmlConfiguration
- ))
- context.setContextPath("/")
- context.setParentLoaderPriority(true)
- server.setHandler(context)
- try {
- server.start
- println("\n" * 10)
- server.dumpStdErr
- server.join
- }
- catch { case e: Throwable => e.printStackTrace; System.exit(1) }
- finally System.exit(0)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement