I have a stripped down test project which contains a Servlet version 3.0, declared with annotations like so:
@WebServlet(\"/test\")
public class TestServ
Given the JNDI magic in the snippet you posted:
try {
listBindings = context.getResources().listBindings(
"/WEB-INF/classes");
} catch (NameNotFoundException ignore) {
// Safe to ignore
}
could you maybe set up the same sort of entries in JNDI yourself?
Context ctx = tomcat.addWebapp(...);
FileDirContext fdc = new FileDirContext();
fdc.setDocBase(new File("/path/to/my/classes").getAbsolutePath());
ctx.getResources().createSubcontext("/WEB-INF/classes").bind("myclasses", fdc);