File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
src/main/java/com/huiwan/gdata Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 3
3
import java .io .File ;
4
4
import java .util .ArrayList ;
5
5
import java .util .List ;
6
+ import java .util .concurrent .Executors ;
6
7
7
8
import org .eclipse .jetty .server .Server ;
9
+ import org .eclipse .jetty .util .thread .ExecutorThreadPool ;
8
10
import org .eclipse .jetty .webapp .WebAppContext ;
9
11
import org .slf4j .Logger ;
10
12
import org .slf4j .LoggerFactory ;
@@ -23,6 +25,9 @@ public static void main(String[] args) {
23
25
ignored .printStackTrace ();
24
26
}
25
27
Server server = new Server (port );
28
+ server .setThreadPool (new ExecutorThreadPool (Executors .newFixedThreadPool (200 )));
29
+ server .setThreadPool (new ExecutorThreadPool ());
30
+
26
31
// 关联一个已经存在的上下文 src/main/webapp
27
32
//WebAppContext webAppContext = new WebAppContext("webapp", "/main");
28
33
WebAppContext webAppContext = new WebAppContext (getWebAppPath (), "/zdata" );
Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ public static void main(String[] args) throws Exception {
15
15
// 设置线程
16
16
server .setThreadPool (new ExecutorThreadPool ());
17
17
// 端口
18
- connector .setPort (9808 );
18
+ connector .setPort (9899 );
19
19
// 设置handler
20
- //项目目录名/src/main/webapp
21
- //lib/webapp
22
- //demo
23
- Handler handler =new WebAppContext ("src/main/webapp" , "/" );
20
+ // 项目目录名/src/main/webapp
21
+ // lib/webapp
22
+ // demo
23
+ // Handler handler=new WebAppContext("src/main/webapp", "/");
24
24
25
25
server .setHandler (new WebAppContext ("src/main/webapp" , "/" ));
26
26
// 连接器
You can’t perform that action at this time.
0 commit comments