one application with two servlets each listening on separate ports

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

one application with two servlets each listening on separate ports

gjb9876
This post was updated on .
I'm using jetty-6.1.21

I have a single application, with two servlets (two separate APIs).  One API (one servlet) must listen on one port (say 8080) but the other servlet on a different port 8081.  They share an object in memory (otherwise we'll need to read/write to a database to go between these two servlets).  8080 is open to the outside www network.  8081 is only available to our internal network.  I want to know how to bind a particular servlet to a particular port.

Is there a setting I can specify in the web.xml for each url-pattern to select which connector to use?

Is there a setting in jetty.xml to tell a connector to restrict to a url-pattern or package name or something?

I've been able to setup two ports, two applications, but this runs on two server instances within jetty.  I need them to share an object in memory... ideas appreciated :)

example jetty.xml and web.xml would be great.

Thanks for your help,
GJB