您的位置:首页 > 编程语言 > Java开发

jetty使用教程(嵌入eclipse开发)

2014-07-11 11:57 363 查看
在eclipse下面建一个java project

package org.jetty.demo;
//启动类,入口
public class JettyServerStart {
public static void main(String[] args) {
JettyCustomServer server = new JettyCustomServer(
"./jetty/etc/jetty.xml", "/testContext");
server.startServer();

}
}


View Code



运行这个类相当于启动了整个工程:

访问index.jsp

http://localhost:8080/testContext/index.jsp



访问HelloWorldServlet:

http://localhost:8080/testContext/servlet/HelloWorldServlet

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: