0

We are using an embedded jetty instance that we pass a .war file to host a web application. That works very well.

Now, we want to call methods in the hosting java application (that started the jetty server) What is the best way to call methods in the hosting java application from e.g. servlets inside the webapp without having to use TCP-IP connections, etc?

Is there an easy way?

Thanks in advance

AndyB
  • 556
  • 1
  • 9
  • 25

1 Answers1

0

One possible way is to share interfaces so that your web application is built against the interfaces and to use JNDI to obtain the implementing objects from the server.

On server side you only have to publish the implementing instances via JNDI.

vanje
  • 10,180
  • 2
  • 31
  • 47