Deploying webapp servlets in an embedded approach

Is there any easy way to deploy a captured capture servlet web application?

For example, with a pier, I can deploy like this:

Server server = new Server(8080); WebAppContext context = new WebAppContext(); context.setContextPath("/"); context.setDescriptor("src/main/webapp/web.xml"); context.setResourceBase("src/main/webapp/"); server.setHandler(context); server.start(); 

Is there a similar way to do this with? I gave an example here: https://github.com/undertow-io/undertow/blob/master/examples/src/main/java/io/undertow/examples/servlet/ServletServer.java , but that does not mean that I I want it to register servlets one by one ...

+8
java jboss undertow
source share
2 answers

Not now.

Undertow simply provides a builder API that another application can use to create the servlet. It was a deliberate design choice, as it fully fits the deployment application into deployment.

We can ultimately add support for this in another module (most likely by snatching the corresponding code from Wildfly), but at the moment it is not high in the list of priorities.

+3
source share

I think that the new swirl wildfly project provides a good workaround for this, since you can deploy any webapp only with a selection module selected from the wild and packaged in one fat jar. Good example: https://github.com/wildfly-swarm/wildfly-swarm-examples/tree/master/servlet

+2
source share

All Articles