开发者

communication between an embedded jetty and its parent application

i have windows service app and i want to use web interface for my app instead of gui. But i wonder how 开发者_如何学Goto make a servlet in jetty communicate with its hosted application - the windows service app.

Thank you.


Since you are going from inside a JVM (jetty) to outside the JVM (your service), you will probably have to use sockets, unless you want to delve into JNI (java native interface), but that's probably more work than you want.

I am assuming that your windows service is an actual native windows app and not a Java app with a service wrapper around it.

Good luck.


You can use the same classloader to solve the problem by:

WebAppContext webapp = new WebAppContext(jetty_home + "/JavaServices", "/JavaServices");
webapp.setDefaultsDescriptor(jetty_home+"/etc/webdefault.xml");
webapp.setClassLoader(Thread.currentThread().getContextClassLoader());//THIS LINE IS THE KEY
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜