I'm starting Jetty from inside the Java program itself. I'm simply trying to get it to point at a cgi-folder that I've placed underneath the package directory (/src/package/cgi-bin)
The problem is that every time I start up the server, it complains "no CGI bin!". Where is the correct location to put your cgi-bin and point at it? This is what I have:
public static void main(String[] args) throws Exception {
// The core Jetty server running on 8080
Server server = new org.eclipse.jetty.server.Server(8080);
// Setup CGI routing
ServletContextHandler context2 = new ServletContextHandler(ServletContextHandler.SESSIONS);
context2.setContextPath("/");
context2.setInitParameter("commandPrefix", "perl");
// Where does this point to?
context2.setInitParameter("cgibinResourceBase", "cgi-bin");
server.setHandler(context2);
// Add the CGI Servlet
context2.addServlet(new ServletHolder(new Cgi()), "/cgi");
server.start();
server.join();
}
See Jetty setInitParameter is NOT initializing any parameter for the answer to this question.