@Override public ServletConfig getServletConfig() { return wrappedServlet.getServletConfig(); }
@Test public void servletHandlerAdapter() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(getServletContext(), "GET", "/servlet.do"); MockHttpServletResponse response = new MockHttpServletResponse(); complexDispatcherServlet.service(request, response); assertEquals("body", response.getContentAsString()); Servlet myServlet = (Servlet) complexDispatcherServlet.getWebApplicationContext().getBean("myServlet"); assertEquals("complex", myServlet.getServletConfig().getServletName()); assertEquals(getServletContext(), myServlet.getServletConfig().getServletContext()); complexDispatcherServlet.destroy(); assertNull(myServlet.getServletConfig()); }
/** * Create a ServletConfiguration using the initialization parameter of * the specified servlet. * * @param servlet the servlet */ public ServletConfiguration(final Servlet servlet) { this(servlet.getServletConfig()); }
/** * Create a ServletContextConfiguration using the context of * the specified servlet. * * @param servlet the servlet */ public ServletContextConfiguration(final Servlet servlet) { this.context = servlet.getServletConfig().getServletContext(); }
public void request(WebRequest webRequest) { try { invocationContext = client.newInvocation(webRequest); rawRequest = new MyHttpRequest(invocationContext.getRequest(), webRequest.getURL().toExternalForm()); rawResponse = new MyHttpResponse(invocationContext.getResponse()); servletContext = invocationContext.getServlet().getServletConfig().getServletContext(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } if (requestContexts != null) { requestContext = requestContexts.getRequestContext(servletContext, rawRequest, rawResponse); } }
public void request(WebRequest webRequest) { try { invocationContext = client.newInvocation(webRequest); rawRequest = new MyHttpRequest(invocationContext.getRequest(), webRequest.getURL().toExternalForm()); rawResponse = new MyHttpResponse(invocationContext.getResponse()); servletContext = invocationContext.getServlet().getServletConfig().getServletContext(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } if (requestContexts != null) { requestContext = requestContexts.getRequestContext(servletContext, rawRequest, rawResponse); } }
public ServletConfigurator(Servlet servlet) { super(); this.servlet = servlet; this.config = servlet.getServletConfig(); }
/** * Create a ServletConfiguration using the initialization parameter of * the specified servlet. * * @param servlet the servlet */ public ServletConfiguration(Servlet servlet) { this(servlet.getServletConfig()); }
/** * Returns the configuration for this Servlet. * * @return the configuration for this Servlet */ public ServletConfig getServletConfig() { return _delegate.getServletConfig(); }
@Override public ServletConfig getServletConfig() { return displayChart.getServletConfig(); }
/** * <p>getServletConfig.</p> * * @return a {@link javax.servlet.ServletConfig} object. */ public ServletConfig getServletConfig() { return delegateServlet.getServletConfig(); }
/** * Create a ServletConfiguration using the initialization parameter of * the specified servlet. * * @param servlet the servlet */ public ServletConfiguration(Servlet servlet) { this(servlet.getServletConfig()); }
@Override public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws IOException, IllegalStateException, IllegalArgumentException { this.servletConfig = servlet.getServletConfig(); this.servletContext = servlet.getServletConfig().getServletContext(); this.request = request; this.response = response; }
/** * Create a ServletContextConfiguration using the context of * the specified servlet. * * @param servlet the servlet */ public ServletContextConfiguration(Servlet servlet) { this.context = servlet.getServletConfig().getServletContext(); }
public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) { this.config = servlet.getServletConfig(); this.request = request; this.response = response; jspWriter = new MockJspWriter(); outStack = new Stack(); attributes = new HashMap(); }
public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) { this.config = servlet.getServletConfig(); this.request = request; this.response = response; jspWriter = new MockJspWriter(); outStack = new Stack(); attributes = new HashMap(); }
public void update(Servlet servlet, Collection<BasicRequestHandler> basicRequestHandlers){ try { servlet.init(this.servlet.getServletConfig()); } catch (ServletException e) { throw new RuntimeException(e); } this.servlet=servlet; this.basicRequestHandler = basicRequestHandlers==null? Collections.emptyList():new ArrayList<>(basicRequestHandlers); }
@Nonnull @Nonempty public String getServletName () { return m_aServlet.getServletConfig ().getServletName (); }
/** * Get Servlet-Services month path. * * @return month path */ @ManagedAttribute(description = "Returns list of registered Servlet-Services with their month paths") public final String getServletServiceMountPaths() { ServletContext servletContext = this.servlet.getServletConfig().getServletContext(); ServletServiceContext context = (ServletServiceContext) servletContext; return context.getMountPath(); }
public HttpSession getSession() { HttpSession session = request.getSession(); if (session != null) { return dispatchTargets.peek().getContextController().getSessionAdaptor( session, dispatchTargets.peek().getServletRegistration().getT().getServletConfig().getServletContext()); } return null; }