没有合适的资源?快使用搜索试试~ 我知道了~
首页jetty documentation
jetty documentation
需积分: 9 20 下载量 57 浏览量
更新于2023-03-16
评论
收藏 4.31MB PDF 举报
Jetty 是一个用 Java 实现、开源、基于标准的,并且具有丰富功能的 Http 服务器和 Web 容器,可以免费的用于商业行为。Jetty 这个项目成立于 1995 年,现在已经有非常多的成功产品基于 Jetty,比如 Apache Geromino, JBoss, IBM Tivoli, Cisco SESM 等。Jetty 可以用来作为一个传统的 Web 服务器,也可以作为一个动态的内容服务器,并且 Jetty 可以非常容易的嵌入到 Java 应用程序当中。
资源详情
资源评论
资源推荐
ii
Table of Contents
I. Getting Started With Jetty ........................................................................................... 1
1. Introducing Jetty ............................................................................................... 3
What is Jetty? .............................................................................................. 3
What Version Do I Use? ................................................................................ 3
Jetty and Java EE Web Profile ........................................................................ 4
2. Using Jetty Introduction ..................................................................................... 7
Downloading Jetty ........................................................................................ 7
Running Jetty ............................................................................................... 8
Deploying Web Applications ......................................................................... 11
Finding Jetty in Maven ................................................................................ 12
3. Jetty Configuration Introduction ......................................................................... 13
How to Configure Jetty ................................................................................ 13
What to Configure in Jetty ............................................................................ 17
II. Jetty Configuration .................................................................................................. 24
4. Deploying to Jetty ........................................................................................... 26
Anatomy of a Web Application ..................................................................... 26
Automatic Web Application Deployment ......................................................... 26
Configuring a Specific Web Application Deployment ......................................... 27
Deployment Processing of WebAppContexts .................................................... 29
Configuring Static Content Deployment .......................................................... 34
Hot Deployment .......................................................................................... 34
Deployment Architecture .............................................................................. 35
Quickstart Webapps ..................................................................................... 39
Overlay WebApp Deployer ........................................................................... 40
5. Configuring Contexts ....................................................................................... 47
Setting a Context Path ................................................................................. 47
Configuring Virtual Hosts ............................................................................. 48
Temporary Directories .................................................................................. 51
Serving a WebApp from a Particular Port/Connector .......................................... 54
Creating Custom Error Pages ........................................................................ 55
Setting Max Form Size ................................................................................ 58
6. Configuring Jetty Connectors ............................................................................. 59
Connector Configuration Overview ................................................................. 59
Configuring SSL ......................................................................................... 63
Setting Port 80 Access for a Non-Root User ..................................................... 70
7. Configuring Security ........................................................................................ 74
Jetty 9.1: Using the ${jetty.home} and ${jetty.base} Concepts to Configure Secu-
rity ........................................................................................................... 74
Authentication ............................................................................................ 81
Limiting Form Content ................................................................................. 87
Aliased Files and Symbolic links ................................................................... 88
Secure Password Obfuscation ........................................................................ 89
JAAS Support ............................................................................................. 91
Spnego Support ........................................................................................... 97
8. Configuring JSP Support ................................................................................. 101
Configuring JSP ........................................................................................ 101
III. Jetty Administration Guide ..................................................................................... 111
9. Starting Jetty ................................................................................................. 114
Startup Overview ....................................................................................... 114
Managing XML Based Startup Configuration ................................................. 117
Managing Server Classpath ......................................................................... 117
Managing Startup Modules .......................................................................... 119
Managing Jetty Base and Jetty Home ............................................................ 126
Using start.jar ........................................................................................... 131
Startup a Unix Service using jetty.sh ............................................................. 134
Jetty : The Definitive Reference
iii
Startup via Windows Service ....................................................................... 138
10. Session Management ..................................................................................... 144
Setting Session Characteristics ..................................................................... 144
Using Persistent Sessions ............................................................................ 147
Session Clustering with a Database ............................................................... 149
Session Clustering with MongoDB ............................................................... 152
11. Configuring JNDI ......................................................................................... 157
Quick Setup .............................................................................................. 157
Working with Jetty JNDI ............................................................................ 157
Configuring JNDI ...................................................................................... 159
Using JNDI with Jetty Embedded ................................................................. 164
Datasource Examples ................................................................................. 166
12. Annotations ................................................................................................. 172
Quick Setup .............................................................................................. 172
Working with Annotations .......................................................................... 172
Using Annotations with Jetty Embedded ........................................................ 175
13. JMX .......................................................................................................... 179
Using Java Management Extensions (JMX) .................................................... 179
Jetty JConsole ........................................................................................... 182
Jetty JMX Annotations ............................................................................... 184
14. SPDY ......................................................................................................... 187
Introducing SPDY ..................................................................................... 187
Configuring SPDY ..................................................................................... 187
Configuring SPDY Proxy ............................................................................ 188
Configuring SPDY push ............................................................................. 194
Implement a custom SPDY PushStrategy ....................................................... 197
15. ALPN ........................................................................................................ 199
.............................................................................................................. 199
16. NPN .......................................................................................................... 204
.............................................................................................................. 204
17. FastCGI Support .......................................................................................... 209
FastCGI Introduction .................................................................................. 209
Configuring Jetty for FastCGI ...................................................................... 209
18. Provided Servlets, Filters, and Handlers ............................................................ 213
Default Servlet .......................................................................................... 213
Proxy Servlet ............................................................................................ 214
Balancer Servlet ........................................................................................ 215
CGI Servlet .............................................................................................. 216
Quality of Service Filter ............................................................................. 217
Denial of Service Filter .............................................................................. 219
Gzip Filter ................................................................................................ 221
Cross Origin Filter ..................................................................................... 223
Resource Handler ...................................................................................... 225
Debug Handler .......................................................................................... 226
Statistics Handler ....................................................................................... 227
IP Access Handler ..................................................................................... 229
Moved Context Handler .............................................................................. 230
Shutdown Handler ..................................................................................... 231
Default Handler ......................................................................................... 232
Error Handler ............................................................................................ 233
Rewrite Handler ........................................................................................ 233
19. Jetty Runner ................................................................................................ 238
Use Jetty without an installed distribution ...................................................... 238
20. Optimizing Jetty ........................................................................................... 244
Garbage Collection .................................................................................... 244
High Load ................................................................................................ 245
Limiting Load ........................................................................................... 247
21. Jetty Logging ............................................................................................... 249
Jetty : The Definitive Reference
iv
Configuring Jetty Logging ........................................................................... 249
Default Logging with Jetty's StdErrLog ......................................................... 250
Configuring Jetty Request Logs .................................................................... 252
Example: Logging with Apache Log4j .......................................................... 254
Example: Logging with Java's java.util.logging via Slf4j ................................... 255
Example: Logging with Java's java.util.logging via JavaUtilLog ......................... 257
Example: Logging with Logback .................................................................. 258
Example: Capturing Multiple Logging Frameworks with Slf4j ............................ 260
Example: Centralized Logging with Logback .................................................. 263
Jetty Dump Tool ....................................................................................... 265
IV. Jetty Development Guide ....................................................................................... 286
22. Maven and Jetty ........................................................................................... 288
Using Maven ............................................................................................ 288
Configuring the Jetty Maven Plugin .............................................................. 292
Files Scanned by the Jetty Maven Plugin ....................................................... 311
Jetty Jspc Maven Plugin ............................................................................. 311
23. Using Ant with Jetty ..................................................................................... 316
Using the Ant Jetty Plugin .......................................................................... 316
24. Handlers ..................................................................................................... 326
Writing Custom Handlers ............................................................................ 326
25. Embedding .................................................................................................. 329
Jetty Embedded HelloWorld ........................................................................ 329
Embedding Jetty ........................................................................................ 330
Embedded Examples .................................................................................. 335
26. Debugging .................................................................................................. 341
Options .................................................................................................... 341
Enable remote debugging ............................................................................ 341
Debugging With Eclipse ............................................................................. 342
Debugging With IntelliJ .............................................................................. 344
27. Frameworks ................................................................................................. 349
Spring Setup ............................................................................................. 349
OSGI ....................................................................................................... 350
Weld ....................................................................................................... 372
Metro ...................................................................................................... 373
28. HTTP Client ................................................................................................ 374
Introduction .............................................................................................. 374
API Usage ................................................................................................ 375
Other Features ........................................................................................... 381
29. WebSocket Introduction ................................................................................ 384
What Jetty provides ................................................................................... 384
WebSocket APIs ....................................................................................... 385
30. Jetty Websocket API ..................................................................................... 386
Jetty WebSocket API Usage ........................................................................ 386
WebSocket Events ..................................................................................... 386
WebSocket Session .................................................................................... 387
Send Messages to Remote Endpoint .............................................................. 387
Using WebSocket Annotations ..................................................................... 392
Using WebSocketListener ........................................................................... 393
Using the WebSocketAdapter ...................................................................... 394
Jetty WebSocket Server API ........................................................................ 395
Jetty WebSocket Client API ........................................................................ 397
31. Java Websocket API ..................................................................................... 400
Java WebSocket Client API Usage ............................................................... 400
Java WebSocket Server API ........................................................................ 400
V. Reference Guide ................................................................................................... 401
32. Platforms, Stacks and Alternative Distributions .................................................. 403
Many many options... ................................................................................. 403
Jelastic ..................................................................................................... 403
Jetty : The Definitive Reference
v
CloudFoundry ........................................................................................... 403
Amazon Elastic Beanstalk ........................................................................... 405
Fedora ..................................................................................................... 407
Ubuntu .................................................................................................... 407
33. Architecture ................................................................................................. 408
Jetty Architecture ...................................................................................... 408
Jetty Classloading ...................................................................................... 414
Managing 1xx Responses ............................................................................ 417
Creating a Custom Protocol ......................................................................... 417
34. Contributing to Jetty ..................................................................................... 420
Community ............................................................................................... 420
Documentation .......................................................................................... 421
Source Control and Building ........................................................................ 424
Coding Standards ...................................................................................... 426
Issues, Features, and Bugs ........................................................................... 427
Contributing Patches .................................................................................. 427
Releasing Jetty .......................................................................................... 431
Testing a Jetty Release ............................................................................... 435
35. Reference Section ......................................................................................... 440
Jetty XML Syntax ..................................................................................... 440
Jetty XML Usage ...................................................................................... 452
jetty.xml ............................................................................................. 453
jetty-web.xml ..................................................................................... 454
jetty-env.xml ..................................................................................... 455
webdefault.xml ................................................................................... 456
Jetty override-web.xml ....................................................................... 458
36. Troubleshooting ........................................................................................... 460
Troubleshooting Zip Exceptions ................................................................... 460
Troubleshooting Locked Files on Windows .................................................... 460
Preventing Memory Leaks ........................................................................... 462
Jetty Security Reports ................................................................................. 465
剩余472页未读,继续阅读
happy_boys_
- 粉丝: 8
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 面 向 对 象 课 程 设 计(很详细)
- 复杂可编程逻辑器件ppt课件.ppt
- 2021.12-2021居住客群消费趋势年报-贝壳-20页.pdf
- (完整word版)基于单片机的智能交通灯控制系统设计.doc
- 四川天羚绒业公司电子商务营销策略研究.docx
- TI-DS125BR111.pdf
- Oracle培训基础1.ppt
- SAP-Warehouse-Insights-中文介绍
- sed&awk;手册
- MATLAB6.0数学手册精简版
- 年数据库技术大会万振龙数据治理与大数据平台设计40.pptx
- 计算机组装维修教程11
- 全国统一数据资产登记体系建设白皮书.pdf
- 北邮概率论与随机过程课件 教学内容: 1、事件的独立性; 2、伯努利试验概型。
- 电子商务与民航信息化(PPT).ppt
- SAP等公司的面试题
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0