I have a jar file embedded with jetty and a war file running on winstone. I need to embed two projects with same server or is it possible to embed winstone with jetty server to run on same port?
Asked
Active
Viewed 251 times
1 Answers
3
No, you can't combine those on the same port.
However, you can do something else ...
- Migrate your winstone use to the embedded-jetty-live-war pattern
- Merge your embedded-jetty jar file code into the
theserver/src/main/java/jetty/livewar/ServerMain.java
from theembedded-jetty-live-war
example project (maintained by the Jetty Project)
The end result is a single Server instance, with 2 webapps running in it.
You can choose to have it exist as a live-war (aka winstone like), or as a Jar executable that just loads the WebAppContext
of the war file as a second handler on the Server. (use a HandlerCollection
or HandlerList
with the Server.setHandler()
call)

Joakim Erdfelt
- 46,896
- 7
- 86
- 136