powered by Jive Software

Need Jetty to work with my jsps -- strange happenings

Hi there,

You folks helped me get a basic servlet wrapper up a couple of days ago and all seems good but I’'m still hitting some issues.

Here’'s my code for reference:

this.manager = HttpBindManager.getInstance();

this.pluginDirectory = pluginDirectory;


public void startWebServices(){

String webloc = pluginDirectory.getAbsolutePath();


ContextHandlerCollection contexts = manager.getContexts();

context = new WebAppContext(webloc, “/” + pluginDirectory.getName());


System.out.println(pluginDirectory.getAbsolutePath() + File.separator + “web”);

context.addServlet(new ServletHolder(new A7PageSrcServlet()), “/ride/pagesource/*”);

context.addServlet(new ServletHolder(new A7HttpController()), “/ride/*”);


context.setWelcomeFiles(new String[]{“index.jsp”});


try {


}catch (Exception e) {



So this code works, but I have no way of loading jsps out of the plugin – because it seems like it’'s not reading my web.xml file in the WEB-INF directory.

Also, it exposes my entire plugin over port 8080 and again, since I’'m not pointing to my web directory, I have no config file to block access with.

When I re-map the WebAppContext so that it points to the web folder the jar won’'t load.

So I guess I wish that jetty were better documented - or is it?

What config file will get loaded from within Openfire using Jetty this way?


I figured it out. Turns out that the web.xml file that was part of the plugin was causing the servlet to crash before it ever became active.

One thing that helped for anyone who’‘s trying to wade through this stuff – download jetty and set your WebAppContext to use one of Jetty’'s example apps to see whether or not your code is working.