Eclipse与Jetty服务器集成的最简单方法

Eclipse Jetty Server Configuration Guideline

2010-6-3by kevinxtq@https://www.360docs.net/doc/0012619364.html,

Jetty is a very lightweight web container with the same function as Tomcat but much faster.

It is a ideal web container when debugging or developing the J2EE web application.

In this package, I will show you how to use Jetty in eclipse to debug or run our Web Applications.

1. Prepare

You should have Jetty downloaded. In this tutorial, I use the stable version of Jetty: Jetty 6.1.22.

You can get Jetty from this link:

https://www.360docs.net/doc/0012619364.html,/jetty/

P.S. Since 6.28, Jetty has been a project under Eclipse Fundation, and Jetty 7 is the first release of Jetty@Eclipse.

Because of this movement, some packages name also changed. So, this toturail maybe not work well if you have Jetty7.

I have downloaded the Jetty packge, and extract it in D:\tools\jetty-6.1.22

2. Prepare in Eclipse

Now you need to create a user library for Jetty. Here goes the steps:

D:\tools\jetty-6.1.22

D:\tools\jetty-6.1.22\lib D:\tools\jetty-6.1.22\lib\jsp-2.1

This is the final settings of User Library:

3. Create Jetty Server Project

In Eclipse, create an empty java project like this:

Note that I have add the User Library into this project and remove the src folder, because I don't need to write source now.

4. Write the config files

10

200

20

2

30000

2

false

8443

5000

5000

/contexts

1

/etc/deployment.properties

true

true

true

1000

alias=/myweb

path=D:/workbench/MyWeb/WebContent

4.4 etc/webdefault.xml

Copy the D:\tools\jetty-6.1.22\etc\webdefault.xml into etc/webdefault.xml

5. Run Jetty Run

In order to run Jetty, following steps are needed:

Jetty is running now 6. Browse my Web

7. Problem

When debug with Jetty, some files can not save after editing.

In this case, you should modify the file etc/webdefault.xml

useFileMappedBuffer

false

相关文档
最新文档