/** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ @Override public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ @Override public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Adds the given servlet mapping to this Context, overriding any * existing mapping for the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ @Override public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ @Override public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ @Override public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ @Override public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Add a new servlet mapping, replacing any existing mapping for * the specified pattern. * * @param pattern URL pattern to be mapped * @param name Name of the corresponding servlet to execute * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ @Override public void addServletMapping(String pattern, String name) { addServletMapping(pattern, name, false); }
/** * Add the given URL pattern as a jsp-property-group. This maps * resources that match the given pattern so they will be passed * to the JSP container. Though there are other elements in the * property group, we only care about the URL pattern here. The * JSP container will parse the rest. * * @param pattern URL pattern to be mapped */ public void addJspMapping(String pattern) { String servletName = findServletMapping("*.jsp"); if (servletName == null) { servletName = "jsp"; } if( findChild(servletName) != null) { addServletMapping(pattern, servletName, true); } else { if(log.isDebugEnabled()) log.debug("Skiping " + pattern + " , no servlet " + servletName); } }
/** * Add the given URL pattern as a jsp-property-group. This maps * resources that match the given pattern so they will be passed * to the JSP container. Though there are other elements in the * property group, we only care about the URL pattern here. The * JSP container will parse the rest. * * @param pattern URL pattern to be mapped */ @Override public void addJspMapping(String pattern) { String servletName = findServletMapping("*.jsp"); if (servletName == null) { servletName = "jsp"; } if( findChild(servletName) != null) { addServletMapping(pattern, servletName, true); } else { if (log.isLoggable(Level.FINE)) { log.log(Level.FINE, "Skipping " + pattern + " , no servlet " + servletName); } } }
public Set<String> addMapping(String... urlPatterns) { if (ctx.isContextInitializedCalled()) { String msg = MessageFormat.format(rb.getString(LogFacade.SERVLET_REGISTRATION_ALREADY_INIT), new Object[] {"mapping", wrapper.getName(), ctx.getName()}); throw new IllegalStateException(msg); } if (urlPatterns == null || urlPatterns.length == 0) { String msg = MessageFormat.format(rb.getString(LogFacade.SERVLET_REGISTRATION_MAPPING_URL_PATTERNS_EXCEPTION), new Object[] {wrapper.getName(), ctx.getName()}); throw new IllegalArgumentException(msg); } return ctx.addServletMapping(wrapper.getName(), urlPatterns); }
/** * Adds the given servlet mappings to this Context. * * <p>If any of the specified URL patterns are already mapped to a * different Servlet, no updates will be performed. * * @param servletMap the Servlet mappings containing the Servlet name * and URL patterns * * @return the (possibly empty) Set of URL patterns that are already * mapped to a different Servlet * * @exception IllegalArgumentException if the specified servlet name * is not known to this Context */ public Set<String> addServletMapping(ServletMap servletMap) { return addServletMapping(servletMap.getServletName(), servletMap.getURLPatterns()); }
/** * Add the given URL pattern as a jsp-property-group. This maps * resources that match the given pattern so they will be passed * to the JSP container. Though there are other elements in the * property group, we only care about the URL pattern here. The * JSP container will parse the rest. * * @param pattern URL pattern to be mapped */ public void addJspMapping(String pattern) { String servletName = findServletMapping("*.jsp"); if (servletName == null) { servletName = "jsp"; } if( findChild(servletName) != null) { addServletMapping(pattern, servletName, true); } else { if(log.isDebugEnabled()) log.debug("Skiping " + pattern + " , no servlet " + servletName); } }
/** * Add the given URL pattern as a jsp-property-group. This maps * resources that match the given pattern so they will be passed * to the JSP container. Though there are other elements in the * property group, we only care about the URL pattern here. The * JSP container will parse the rest. * * @param pattern URL pattern to be mapped */ public void addJspMapping(String pattern) { String servletName = findServletMapping("*.jsp"); if (servletName == null) { servletName = "jsp"; } if( findChild(servletName) != null) { addServletMapping(pattern, servletName, true); } else { CatalinaLogger.CORE_LOGGER.missingJspServlet(); } }
addServletMapping(jspMappings[i], child.getName());
private static void addServlets(JBossWebMetaData jbwebMD, StandardContext context) { for (JBossServletMetaData smd : jbwebMD.getServlets()) { final String sc = smd.getServletClass(); if (sc.equals(WSFServlet.class.getName())) { final String servletName = smd.getServletName(); List<ParamValueMetaData> params = smd.getInitParam(); List<String> urlPatterns = null; for (ServletMappingMetaData smmd : jbwebMD.getServletMappings()) { if (smmd.getServletName().equals(servletName)) { urlPatterns = smmd.getUrlPatterns(); break; } } WSFServlet wsfs = new WSFServlet(); Wrapper wsfsWrapper = context.createWrapper(); wsfsWrapper.setName(servletName); wsfsWrapper.setServlet(wsfs); wsfsWrapper.setServletClass(WSFServlet.class.getName()); for (ParamValueMetaData param : params) { wsfsWrapper.addInitParameter(param.getParamName(), param.getParamValue()); } context.addChild(wsfsWrapper); for (String urlPattern : urlPatterns) { context.addServletMapping(urlPattern, servletName); } } } }
appContext.addServletMapping(TESTRUNNER_URL, TESTRUNNER_NAME);
@Init public void init() throws ServletHostException { connector = connectorService.getConnector(); dispatchingServlet = new Fabric3DispatchingServlet(); Fabric3ServletWrapper wrapper = new Fabric3ServletWrapper(dispatchingServlet); wrapper.setName("Fabric3Servlet"); for (Container container : connector.getContainer().findChildren()) { if (container instanceof StandardHost) { Container child = container.findChild(""); if (child != null) { container.removeChild(child); } StandardContext context = createContext("", "."); context.addChild(wrapper); context.addServletMapping("/*", "Fabric3Servlet"); container.addChild(context); try { dispatchingServlet.init(wrapper); } catch (ServletException e) { throw new AssertionError(e); } } } }