0
# Web and HTTP Libraries
1
2
Web servers, HTTP clients, and web framework components with embedded server support. These libraries provide the foundation for web applications and HTTP communication in Spring Boot.
3
4
## Capabilities
5
6
### Embedded Web Servers
7
8
Production-ready embedded servers with auto-configuration and customization support.
9
10
```gradle { .api }
11
// Apache Tomcat (default for spring-boot-starter-web)
12
'org.apache.tomcat.embed:tomcat-embed-core' // 10.1.42
13
'org.apache.tomcat.embed:tomcat-embed-el' // 10.1.42
14
'org.apache.tomcat.embed:tomcat-embed-jasper' // 10.1.42
15
'org.apache.tomcat.embed:tomcat-embed-websocket' // 10.1.42
16
17
// Eclipse Jetty
18
'org.eclipse.jetty:jetty-server' // 12.0.22
19
'org.eclipse.jetty:jetty-servlet' // 12.0.22
20
'org.eclipse.jetty:jetty-webapp' // 12.0.22
21
'org.eclipse.jetty:jetty-websocket-server' // 12.0.22
22
23
// Undertow
24
'io.undertow:undertow-core' // 2.3.18.Final
25
'io.undertow:undertow-servlet' // 2.3.18.Final
26
'io.undertow:undertow-websockets-jsr' // 2.3.18.Final
27
28
// Netty (for reactive web applications)
29
'io.netty:netty-codec-http' // 4.1.122.Final
30
'io.netty:netty-handler' // 4.1.122.Final
31
'io.netty:netty-transport-native-epoll' // 4.1.122.Final
32
```
33
34
### HTTP Clients
35
36
HTTP client libraries for outbound communication and API integration.
37
38
```gradle { .api }
39
// Apache HttpComponents Client 5.x
40
'org.apache.httpcomponents.client5:httpclient5' // 5.5
41
'org.apache.httpcomponents.client5:httpclient5-cache' // 5.5
42
'org.apache.httpcomponents.client5:httpclient5-fluent' // 5.5
43
44
// Apache HttpComponents Core 5.x
45
'org.apache.httpcomponents.core5:httpcore5' // 5.3.4
46
'org.apache.httpcomponents.core5:httpcore5-h2' // 5.3.4
47
'org.apache.httpcomponents.core5:httpcore5-reactive' // 5.3.4
48
49
// Apache HttpComponents Client 4.x (legacy)
50
'org.apache.httpcomponents:httpasyncclient' // 4.1.5
51
52
// Apache HttpComponents Core 4.x (legacy)
53
'org.apache.httpcomponents:httpcore' // 4.4.16
54
'org.apache.httpcomponents:httpcore-nio' // 4.4.16
55
56
// Jetty Reactive HTTP Client
57
'org.eclipse.jetty:jetty-reactive-httpclient' // 4.0.10
58
```
59
60
### Web Framework Components
61
62
JAX-RS, servlet, and web framework implementation libraries.
63
64
```gradle { .api }
65
// Jersey (JAX-RS implementation)
66
'org.glassfish.jersey.core:jersey-server' // 3.1.10
67
'org.glassfish.jersey.core:jersey-client' // 3.1.10
68
'org.glassfish.jersey.core:jersey-common' // 3.1.10
69
'org.glassfish.jersey.containers:jersey-container-servlet' // 3.1.10
70
'org.glassfish.jersey.media:jersey-media-json-jackson' // 3.1.10
71
72
// Jakarta Servlet API
73
'jakarta.servlet:jakarta.servlet-api' // 6.0.0
74
75
// Jakarta WebSocket API
76
'jakarta.websocket:jakarta.websocket-api' // 2.1.1
77
'jakarta.websocket:jakarta.websocket-client-api' // 2.1.1
78
79
// Jakarta JAX-RS API
80
'jakarta.ws.rs:jakarta.ws.rs-api' // 3.1.0
81
82
// GraphQL Java
83
'com.graphql-java:graphql-java' // 24.0
84
```
85
86
### Template Engines
87
88
Server-side template engines for dynamic HTML generation.
89
90
```gradle { .api }
91
// Thymeleaf
92
'org.thymeleaf:thymeleaf' // 3.1.3.RELEASE
93
'org.thymeleaf:thymeleaf-spring6' // 3.1.3.RELEASE
94
'org.thymeleaf.extras:thymeleaf-extras-springsecurity6' // 3.1.3.RELEASE
95
'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' // 3.4.0
96
97
// FreeMarker
98
'org.freemarker:freemarker' // 2.3.34
99
100
// Mustache
101
'com.samskivert:jmustache' // 1.16
102
103
// JSTL
104
'org.glassfish.web:jakarta.servlet.jsp.jstl' // 3.0.1
105
'jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api' // 3.0.2
106
```
107
108
### WebJars Support
109
110
Client-side library management through Maven/Gradle.
111
112
```gradle { .api }
113
// WebJars locator (finds WebJars on classpath)
114
'org.webjars:webjars-locator-core' // 0.59
115
'org.webjars:webjars-locator-lite' // 1.1.0
116
```
117
118
### Web Testing
119
120
Web application testing support with mock servers and browsers.
121
122
```gradle { .api }
123
// HtmlUnit (headless browser for testing)
124
'org.htmlunit:htmlunit' // 4.11.1
125
126
// Selenium WebDriver
127
'org.seleniumhq.selenium:selenium-java' // 4.31.0
128
'org.seleniumhq.selenium:selenium-chrome-driver' // 4.31.0
129
'org.seleniumhq.selenium:selenium-firefox-driver' // 4.31.0
130
'org.seleniumhq.selenium:htmlunit3-driver' // 4.30.0
131
132
// REST Assured (REST API testing)
133
'io.rest-assured:rest-assured' // 5.5.5
134
'io.rest-assured:json-path' // 5.5.5
135
'io.rest-assured:xml-path' // 5.5.5
136
```
137
138
## Usage Examples
139
140
### Basic Web Application
141
142
```gradle
143
dependencies {
144
implementation platform('org.springframework.boot:spring-boot-dependencies:3.5.3')
145
146
// Uses Tomcat by default
147
implementation 'org.springframework.boot:spring-boot-starter-web'
148
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
149
150
testImplementation 'org.springframework.boot:spring-boot-starter-test'
151
}
152
```
153
154
### Jetty Web Server
155
156
```gradle
157
dependencies {
158
implementation platform('org.springframework.boot:spring-boot-dependencies:3.5.3')
159
160
implementation('org.springframework.boot:spring-boot-starter-web') {
161
exclude module: 'spring-boot-starter-tomcat'
162
}
163
implementation 'org.springframework.boot:spring-boot-starter-jetty'
164
165
testImplementation 'org.springframework.boot:spring-boot-starter-test'
166
}
167
```
168
169
### Reactive Web Application
170
171
```gradle
172
dependencies {
173
implementation platform('org.springframework.boot:spring-boot-dependencies:3.5.3')
174
175
// Uses Netty by default
176
implementation 'org.springframework.boot:spring-boot-starter-webflux'
177
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
178
179
testImplementation 'org.springframework.boot:spring-boot-starter-test'
180
}
181
```
182
183
### JAX-RS with Jersey
184
185
```gradle
186
dependencies {
187
implementation platform('org.springframework.boot:spring-boot-dependencies:3.5.3')
188
189
implementation 'org.springframework.boot:spring-boot-starter-jersey'
190
implementation 'org.springframework.boot:spring-boot-starter-json'
191
192
testImplementation 'org.springframework.boot:spring-boot-starter-test'
193
}
194
```
195
196
### GraphQL API
197
198
```gradle
199
dependencies {
200
implementation platform('org.springframework.boot:spring-boot-dependencies:3.5.3')
201
202
implementation 'org.springframework.boot:spring-boot-starter-web'
203
implementation 'org.springframework.boot:spring-boot-starter-graphql'
204
205
testImplementation 'org.springframework.boot:spring-boot-starter-test'
206
}
207
```
208
209
### HTTP Client Integration
210
211
```gradle
212
dependencies {
213
implementation platform('org.springframework.boot:spring-boot-dependencies:3.5.3')
214
215
implementation 'org.springframework.boot:spring-boot-starter-web'
216
implementation 'org.apache.httpcomponents.client5:httpclient5'
217
218
testImplementation 'org.springframework.boot:spring-boot-starter-test'
219
testImplementation 'io.rest-assured:rest-assured'
220
}
221
```
222
223
### WebSocket Support
224
225
```gradle
226
dependencies {
227
implementation platform('org.springframework.boot:spring-boot-dependencies:3.5.3')
228
229
implementation 'org.springframework.boot:spring-boot-starter-websocket'
230
231
testImplementation 'org.springframework.boot:spring-boot-starter-test'
232
}
233
```
234
235
### Template Engine Combinations
236
237
```gradle
238
dependencies {
239
implementation platform('org.springframework.boot:spring-boot-dependencies:3.5.3')
240
241
implementation 'org.springframework.boot:spring-boot-starter-web'
242
243
// Multiple template engines
244
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
245
implementation 'org.springframework.boot:spring-boot-starter-freemarker'
246
247
testImplementation 'org.springframework.boot:spring-boot-starter-test'
248
}
249
```
250
251
### Web Testing Setup
252
253
```gradle
254
dependencies {
255
implementation platform('org.springframework.boot:spring-boot-dependencies:3.5.3')
256
257
implementation 'org.springframework.boot:spring-boot-starter-web'
258
259
testImplementation 'org.springframework.boot:spring-boot-starter-test'
260
testImplementation 'io.rest-assured:rest-assured'
261
testImplementation 'org.htmlunit:htmlunit'
262
testImplementation 'org.seleniumhq.selenium:selenium-java'
263
}
264
```