There is a RunWebApp.scala that seems to be included in the generated
projects from the maven archetype, you can probably copy it?

object RunWebApp extends Application {
  val server = new Server(8080)
  val context = new WebAppContext()
  context.setServer(server)
  context.setContextPath("/")
  context.setWar("src/main/webapp")

  server.addHandler(context)

  try {
    println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO
STOP")
    server.start()
    while (System.in.available() == 0) {
      Thread.sleep(5000)
    }
    server.stop()
    server.join()
  } catch {
    case exc : Exception => {
      exc.printStackTrace()
      System.exit(100)
    }
  }
}


On Feb 5, 6:22 pm, parki <whatever...@gmail.com> wrote:
> Hello - newbie to scala and (esp) lift.
>
> I'm trying to get lift embedded into a server I wrote which also
> embeds jetty, so trying to avoid making war files, etc (the init code
> is at the end of this email) and thought someone out there might be
> able to point me in the right direction. I am using lift-util-1.0.jar
> and lift-webkit-1.0.jar, a bunch of the jetty jars, and any other jars
> needed to resolve dependencies. I may be a sucker for punishment, but
> everything works fine - the LiftServlet and LiftFilter are installed
> into jetty, and when I surf to :
>
> http://localhost:8081/lift/
>
> I get a 'broken link' error response to the browser, and the scala
> console outputs:
>
> scala> INFO - Service request (GET) /lift/ took 136 Milliseconds
>
> So, it looks like it's getting to lift, but likely lift thinks that
> there are no web apps, and hence the error (or something).
>
> I have a directory containing a simple hello world lift app created
> with maven archetype:generate, and I'd like to point the LiftServlet
> to that, if at all possible. Or copy that project structure somewhere
> underneath jetty...
>
> I've tried copying the lift app to cwd, the classes directory, the lib
> directory, etc to no avail.
>
> Does anyone know how to get the LiftServlet to find the web apps?
>
> Any help is appreciated.
>
> brian...
>
> --- x8 snip
>
> import com.whatevernot.liaison.servlet.HelloServlet
> import net.liftweb.http.
> import org.eclipse.jetty.server.
> import org.eclipse.jetty.servlet._
>
> val server = new Server(8081)
> val context = new
> ServletContextHandler(ServletContextHandler.SESSIONS)
>
> context.addFilter(new FilterHolder(new LiftFilter()), "/lift/", 1)
> context.addServlet(new ServletHolder(new HelloServlet()), "/hello/")
> context.addServlet(new ServletHolder(new LiftServlet()), "/lift/*")
> context.setContextPath("/")
>
> server.setHandler(context)
> server.start

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to