待更新完了,会出现Jetty Generic Server Adapter,选中,点Next然后一步步安装就好了。
在eclipse的servers视图中新建Server:
选择jetty6,下面一步步配置即可,Jetty_home选择刚才解压出来的jetty6的目录即可,端口不要和其他服务冲突。
在eclipse中新建一个dynamic web project,dynamic web module version选择2.2,在Web content下写一个index.jsp,右击工程,Run as->run on server,选择刚才新建的jetty 6 at localhost,就可以看到效果了,和使用tomcat没有什么不一样。
2.安装run-jetty-run插件
另外一种方法是在eclipse中安装run-jetty-run插件,我觉得这种方式比较好,可以支持jetty7、8,安装方法如下:
在eclipse菜单栏,Run->Install new software->Add,输入地址:http://run-jetty-run.googlecode.com/svn/trunk/updatesite,如下图:
OK,然后勾选RunJettyRun即可
之后一步步安装即可。
安装之后连jetty都不需要安装,插件中带了jetty6、7、8。新建dynamic web project,右击工程,Run as->Run configuration:
引用Jetty buffers static content for webapps such as html files, css files, images etc and uses memory mapped files to do this if the NIO connectors are being used. The problem is that on Windows, memory mapping a file causes the file to be locked, so that the file cannot be updated or replaced. This means that effectively you have to stop Jetty in order to update a file.