ManagedExecutorService executor = (ManagedExecutorService) ctx.lookup("java:comp/env/concurrent/myExecutor2");
// ManagedExecutorService executor = (ManagedExecutorService) ctx.lookup("java:comp/DefaultManagedExecutorService");
for (int i = 0; i < 5; i++) {
out.format("submitting runnable(%d)<br>", i);
executor.submit(new MyRunnableTask(i));
out.format("submitting callable(%d)<br>", i);
executor.submit(new MyCallableTask(i));
}
} catch (NamingException ex) {
Logger.getAnonymousLogger().log(Level.SEVERE, null, ex);