Hi everybody,
I was hoping someone could shed some light on how to bind to 8080 with a servlet. I noticed that there is an HttpBindServlet class in the docs and tried to extend one of my plugin servlets with that but it didn’'t seem to do the trick.
-Walt
private HttpBindManager manager;
private File pluginDirectory;
private WebAppContext context; public ServletLoader(File pluginDirectory, HttpBindManager manager) {
this.manager = manager;
this.pluginDirectory = pluginDirectory;
} public void start() {
ContextHandlerCollection contexts = manager.getContexts();
context = new WebAppContext(pluginDirectory.getPath(),
"/" + pluginDirectory.getName());
// Use the class loader that loaded a class in your plugin
context.setClassLoader(ServletLoader.class.getClassLoader());
context.setWelcomeFiles(new String[]{"/index.jspa"});
contexts.addHandler(context);
try {
context.start();
}
catch (Exception e) {
Log.error(e);
}
}
this should do the trick!
Cheers,
Alex