You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2015-03-17-server.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,12 +9,12 @@ order: 30
9
9
First of all it's important to say that Pippo is based on __Servlet 3.1__ so, it needs a Servlet container to run properly.
10
10
11
11
Most server-side Java applications (e.g. web or service-oriented) are intended to run within a container.
12
-
The traditional way to package these apps for distribution is to bundle them as a WAR file.
13
-
Of course you can use the above model for your application development or you can use the simple way.
14
-
Rather than your application being deployed to a container, an embedded container is deployed within the application itself.
12
+
The traditional way to package these apps for distribution is to bundle them as a WAR file.
13
+
Of course you can use the above model for your application development or you can use the simple way.
14
+
Rather than your application being deployed to a container, an embedded container is deployed within the application itself.
15
15
Pippo comes with Jetty as embedded web server. You can choose another container if you want (for example Tomcat).
16
16
17
-
See below the classic `Hello World` in Pippo using the default web server:
17
+
See below the classic `Hello World` in Pippo:
18
18
19
19
```java
20
20
publicclassHelloWorld {
@@ -100,7 +100,7 @@ new Pippo()
100
100
```
101
101
102
102
Pippo detects automatically the web server using __ServiceLoader__.
103
-
If you want to use a web server in your application, you must add pippo-<servername> as dependency for your project.
103
+
If you want to use a web server in your application, you must add `pippo-<server name>` as dependency for your project.
104
104
Other option is to set programmatically the desired web server using `Pippo#setServer(WebServer server)`.
105
105
106
106
Pippo comes (out of the box) with some web servers (most popular):
@@ -120,10 +120,10 @@ To use one of these servers just add a dependency in your project:
120
120
</dependency>
121
121
```
122
122
123
-
In Pippo, the web servers are plug and play and interchangeable (you can change the web server without to change your code).
123
+
In Pippo, the web servers are plug and play and interchangeable (you can change the web server without to change your code).
124
124
You never work directly with classes from Jetty, Tomcat or other web server.
125
125
126
-
Are some situations (very rare) when the behavior provided by an `WebServer` instance supplied automatically by Pippo is not perfect.
126
+
Are some situations (very rare) when the behavior provided by an `WebServer` instance supplied automatically by Pippo need fine tuning.
127
127
You want to have access to some advanced settings.
128
128
In these situations you need to create a custom WebServer.
129
129
The idea is to create a custom WebServer if you want to override some aspects (methods) of that server or
@@ -233,7 +233,7 @@ public class ServletDemo {
233
233
234
234
}
235
235
```
236
-
__DON'T__ forget to add `@MetaInfServices` on your implementation of `WebServerInitializer`!
236
+
__DON'T__ forget to add `@MetaInfServices` on your implementation of `WebServerInitializer`! This annotation generates `META-INF/services` files automatically.
237
237
The full code is available in [pippo-demo-servlet]({{ site.demourl }}/pippo-demo-servlet) project.
238
238
239
239
If you need to create support for another embedded web server that is not implemented in Pippo or third-party modules
0 commit comments