javalin / javalin/website

Enhance Documentation for the section Other web servers

Open
#263 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
39
Forks
98
PR merge metrics
No merged PRs in 30d

Description

I am trying to migrate my Vaadin/javalin application to version 6.1.0.

I am using [vaadin-boot](https://github.com/mvysny/vaadin-boot) library for Vaadin which already provides an embedded Jetty server. I am looking how to set up a Javalin servlet to service the REST requests and dispatch them through Javalin.

Could you provide _a minimal example_ under https://javalin.io/documentation#other-web-servers how to set up Javalin as a servlet. Or just provide pointers so that I can write an example.

The changes in version 6.x seems to change the approach how to do it. In the older versions we could do:

```
@WebServlet(name = "MyJavalinServlet", urlPatterns = {"/rest/*"})
public class MyJavalinServlet extends HttpServlet {
private final JavalinServlet javalin = Javalin.createStandalone()
.get("/rest", ctx -> ctx.result("Hello!"))
.javalinServlet();

@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
javalin.service(req, resp);
}
}
```
How should we do it with the version 6.x.

Thanks in advance.

Contributor guide

Open the contributing guide

Research direction

Start at the documentation's “Other web servers” section and verify the current Javalin 6.x servlet integration approach against the version 6.x API. Add a minimal example or pointers for mounting Javalin in an existing servlet server, then check that it addresses the Vaadin/embedded Jetty scenario described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.