Experimenting trying to get Lift views to work. (And they don't)
This commit is contained in:
parent
33b030361c
commit
13bc65142e
13 changed files with 41 additions and 9 deletions
|
|
@ -125,9 +125,17 @@ object Kernel extends Logging {
|
|||
val uri = UriBuilder.fromUri(REST_URL).port(REST_PORT).build()
|
||||
val adapter = new ServletAdapter
|
||||
val servlet = new AkkaServlet
|
||||
|
||||
adapter.addInitParameter("bootloader", config.getString("akka.lift.bootloader").getOrElse(null))
|
||||
adapter.addInitParameter("com.sun.jersey.config.feature.Redirect", "true")
|
||||
adapter.addInitParameter("com.sun.jersey.config.feature.ImplicitViewables", "true")
|
||||
adapter.setServletInstance(servlet)
|
||||
adapter.setContextPath(uri.getPath)
|
||||
|
||||
//TODO add initialization of Lift (LiftFilter needs initialization)
|
||||
|
||||
log.debug("REST service context path: [" + uri.getPath + "]")
|
||||
|
||||
val scheme = uri.getScheme
|
||||
if (!scheme.equalsIgnoreCase("http")) throw new IllegalArgumentException("The URI scheme, of the URI " + REST_URL + ", must be equal (ignoring case) to 'http'")
|
||||
|
||||
|
|
@ -136,6 +144,7 @@ object Kernel extends Logging {
|
|||
jerseySelectorThread.setPort(REST_PORT)
|
||||
jerseySelectorThread.setAdapter(adapter)
|
||||
jerseySelectorThread.listen
|
||||
|
||||
log.info("REST service started successfully. Listening to port [" + REST_PORT + "]")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,12 +10,13 @@ import config.ConfiguratorRepository
|
|||
import com.sun.jersey.api.core.{DefaultResourceConfig, ResourceConfig}
|
||||
import com.sun.jersey.spi.container.servlet.ServletContainer
|
||||
import com.sun.jersey.spi.container.WebApplication
|
||||
|
||||
import java.util.HashSet
|
||||
|
||||
class AkkaServlet extends ServletContainer {
|
||||
class AkkaServlet extends ServletContainer{
|
||||
|
||||
override def initiate(rc: ResourceConfig, wa: WebApplication) = {
|
||||
// super.initiate(rc, wa)
|
||||
|
||||
Kernel.boot // will boot if not already booted by 'main'
|
||||
val configurators = ConfiguratorRepository.getConfiguratorsFor(getServletContext);
|
||||
val set = new HashSet[Class[_]]
|
||||
|
|
@ -26,6 +27,6 @@ class AkkaServlet extends ServletContainer {
|
|||
|
||||
wa.initiate(
|
||||
new DefaultResourceConfig(set),
|
||||
new ActorComponentProviderFactory(configurators));
|
||||
new ActorComponentProviderFactory(configurators))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue