Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] setting up Eclipse project for embedded Jetty

On 01/02/2013 06:44, Chris Lauwers wrote:

Apologies for the novice question, but I’m embedding Jetty into my server, and would like recommendations for what type of Eclipse project setup is best suited for this purpose. The server will primarily provide REST-based web services but also needs to serve up some static (HTML/_javascript_) content. I know that if I create a Dynamic Web Content project, Eclipse expects that static content in a WebContent folder and will automatically move this content when creating a WAR file, but since I’m embedding Jetty, a Dynamic Web Content project doesn’t seem like the right way to go.

 

How do I use my Eclipse project setup to manage the HTML content and how do I make sure it ends up in the right place so the embedded Jetty server will find it?

 

Thanks,

 

Chris

 



You do not need anything special for embedded Jetty. A regular java project will do.
For serving static content just use a DefaultServlet, specifying html content root directory (which can be anywhere) with setResourceBase().

Back to the top