How do I serve webapp A only from port A and webapp B only from port B?
You need two org.mortbay.jetty.Server instances for this.
Instance A will have a connector listening on port A with webapp A defined, and instance B will have webapp B and connector listening on port B defined.
Let's clarify that with an example.
Suppose we have webapp A that we want served from port 8080, and webapp B that we want served from an SSL connector on port 8443. We would set up 2 different Server instances, each in it's own jetty xml file like so:
You run both Server instances in the same JVM by providing them both on the runline:
Of course, you could also start two separate jetty instances, one with
jettyA.xml and the other with
jettyB.xml, if you wanted to. However, it is usually more efficient to run both Servers in the same JVM.