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
log.debug("Added servlet '{}' to '{}'", demoServlet.getClassName(), demoServlet.getMappings().iterator().next());
172
+
}
173
+
174
+
@Override
175
+
publicvoiddestroy(ServletContextservletContext) {
176
+
// do nothing
177
+
}
178
+
179
+
}
180
+
```
181
+
182
+
```java
183
+
importro.pippo.core.Pippo;
184
+
185
+
import staticro.pippo.core.route.Route.GET;
186
+
187
+
publicclassServletDemo {
188
+
189
+
publicstaticvoidmain(String[] args) {
190
+
Pippo pippo =newPippo();
191
+
192
+
// set pippo filter path
193
+
pippo.getServer().setPippoFilterPath("/app/*");
194
+
195
+
// add route
196
+
pippo.GET("/", routeContext -> routeContext.send("Hello from Pippo route!"));
197
+
198
+
pippo.start();
199
+
}
200
+
201
+
}
202
+
```
203
+
DON'T forget to add `@MetaInfServices` on your implementation of `WebServerInitializer`!
204
+
The full code is available in [pippo-demo-servlet](({{ site.demourl }}/pippo-demo-servlet)) project.
205
+
206
+
A more complex demo project that shows you how to integrate [Jersey](https://jersey.java.net) is available in [pippo-demo-jersey](({{ site.demourl }}/pippo-demo-jersey)) project.
207
+
This demo is the code source of the article `Pippo and Jersey (JAX-RS): A Match Made in Heaven` available on [DZone](https://dzone.com/articles/pippo-and-jersey-jax-rs).
0 commit comments