Blankman
Blankman

Reputation: 267140

Does Jetty still have WebAppContext?

I'm trying to run my spring MVC using an embedded instance. I found this question: Jetty Embedded Spring application

I am using jetty version: 7.6.2.v20120308, javax servlet: 2.5

I am using IntelliJ and the class WebAppContext doesn't seem to resolve to any package/namespace. Does this class exist or has it been replaced?

import org.eclipse.jetty.server.Server;
public static void main(String[] args) throws Exception {

        Server server = new Server(8080);

        WebAppContext ????????
}

Upvotes: 1

Views: 5227

Answers (2)

jcadcell
jcadcell

Reputation: 811

In addition to adding the dependency on jetty-webapp, connecting it to the server has changed:

from: server.addHandler(webAppContext);

to: server.setHandler(webAppContext);

Upvotes: 0

ndeverge
ndeverge

Reputation: 21564

Just to make sure, does your pom.xml contain this dependency ?

<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-webapp</artifactId>
    <version>7.6.2.v20120308</version>
</dependency>

Upvotes: 8

Related Questions