return ((ServletContextHandler.Context)ctx).createServlet(getHeldClass()); return getHeldClass().getDeclaredConstructor().newInstance();
/** * @return the newly created Servlet instance * @throws ServletException * @throws IllegalAccessException * @throws InstantiationException */ protected Servlet newInstance() throws ServletException, IllegalAccessException, InstantiationException { try { ServletContext ctx = getServletHandler().getServletContext(); if (ctx==null) return getHeldClass().newInstance(); return ((ServletContextHandler.Context)ctx).createServlet(getHeldClass()); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } } }
/** * @return the newly created Servlet instance * @throws ServletException * @throws IllegalAccessException * @throws InstantiationException */ protected Servlet newInstance() throws ServletException, IllegalAccessException, InstantiationException { try { ServletContext ctx = getServletHandler().getServletContext(); if (ctx==null) return getHeldClass().newInstance(); return ((ServletContextHandler.Context)ctx).createServlet(getHeldClass()); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } } }
/** * @return the newly created Servlet instance * @throws ServletException * @throws IllegalAccessException * @throws InstantiationException */ protected Servlet newInstance() throws ServletException, IllegalAccessException, InstantiationException { try { ServletContext ctx = getServletHandler().getServletContext(); if (ctx==null) return getHeldClass().newInstance(); return ((ServletContextHandler.Context)ctx).createServlet(getHeldClass()); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } } }
/** * @return the newly created Servlet instance * @throws ServletException * @throws IllegalAccessException * @throws InstantiationException */ protected Servlet newInstance() throws ServletException, IllegalAccessException, InstantiationException { try { ServletContext ctx = getServletHandler().getServletContext(); if (ctx instanceof ServletContextHandler.Context) return ((ServletContextHandler.Context)ctx).createServlet(getHeldClass()); return getHeldClass().newInstance(); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } }
/** * @return the newly created Servlet instance * @throws ServletException if unable to create a new instance * @throws IllegalAccessException if not allowed to create a new instance * @throws InstantiationException if creating new instance resulted in error */ protected Servlet newInstance() throws ServletException, IllegalAccessException, InstantiationException { try { ServletContext ctx = getServletHandler().getServletContext(); if (ctx instanceof ServletContextHandler.Context) return ((ServletContextHandler.Context)ctx).createServlet(getHeldClass()); return getHeldClass().newInstance(); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } }
/** * @return the newly created Servlet instance * @throws ServletException * @throws IllegalAccessException * @throws InstantiationException */ protected Servlet newInstance() throws ServletException, IllegalAccessException, InstantiationException { try { ServletContext ctx = getServletHandler().getServletContext(); if (ctx instanceof ServletContextHandler.Context) return ((ServletContextHandler.Context)ctx).createServlet(getHeldClass()); return getHeldClass().newInstance(); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } }
/** * @return the newly created Servlet instance * @throws ServletException * @throws IllegalAccessException * @throws InstantiationException */ protected Servlet newInstance() throws ServletException, IllegalAccessException, InstantiationException { try { ServletContext ctx = getServletHandler().getServletContext(); if (ctx instanceof ServletContextHandler.Context) return ((ServletContextHandler.Context)ctx).createServlet(getHeldClass()); return getHeldClass().newInstance(); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } }