@Bean public ServletRegistrationBean camelServlet() { LOG.debug("register: 'CamelServlet' with contextPath: '{}'", servletContext); final ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new CamelHttpTransportServlet(), servletContext); servletRegistrationBean.setName(CAMEL_SERVLET_NAME); return servletRegistrationBean; } }
@Bean public ServletRegistrationBean servletRegistrationBean() { CamelHttpTransportServlet servlet = new CamelHttpTransportServlet("CamelServlet"); servlet.setServletName(); return new ServletRegistrationBean(servlet,"/foo/*"); }
/** * Configures servlet for HTTP communication. * * @return registration bean of {@link CamelHttpTransportServlet}. */ @Bean(name = RouteConstants.CAMEL_SERVLET) @ConditionalOnMissingBean(name = RouteConstants.CAMEL_SERVLET) public ServletRegistrationBean camelHttpServlet() { CamelHttpTransportServlet servlet = new CamelHttpTransportServlet(); servlet.setServletName(RouteConstants.CAMEL_SERVLET); ServletRegistrationBean bean = new ServletRegistrationBean(servlet, RouteConstants.HTTP_URI_PREFIX_MAPPING); bean.setName(servlet.getServletName()); return bean; }
@Bean ServletRegistrationBean camelServlet() { // use a @Bean to register the Camel servlet which we need to do // because we want to use the camel-servlet component for the Camel REST service ServletRegistrationBean mapping = new ServletRegistrationBean(); mapping.setName("CamelServlet"); mapping.setLoadOnStartup(1); mapping.setServlet(new CamelHttpTransportServlet()); mapping.addUrlMappings("/camel/*"); return mapping; }
@Bean ServletRegistrationBean camelServlet() { // TODO: Camel 2.19 should support this OOTB // use a @Bean to register the Camel servlet which we need to do // because we want to use the camel-servlet component for the Camel REST service ServletRegistrationBean mapping = new ServletRegistrationBean(); mapping.setName("CamelServlet"); mapping.setLoadOnStartup(1); // CamelHttpTransportServlet is the name of the Camel servlet to use mapping.setServlet(new CamelHttpTransportServlet()); mapping.addUrlMappings("/api/*"); return mapping; }
@Bean public ServletRegistrationBean servletRegistrationBean() { ServletRegistrationBean mapping = new ServletRegistrationBean(); mapping.setServlet(new CamelHttpTransportServlet()); mapping.addUrlMappings("/webhook/*"); mapping.setName("CamelServlet"); mapping.setLoadOnStartup(1); return mapping; }
@Bean ServletRegistrationBean camelServlet() { // TODO: Camel 2.19 should support this OOTB // use a @Bean to register the Camel servlet which we need to do // because we want to use the camel-servlet component for the Camel REST service ServletRegistrationBean mapping = new ServletRegistrationBean(); mapping.setName("CamelServlet"); mapping.setLoadOnStartup(1); // CamelHttpTransportServlet is the name of the Camel servlet to use mapping.setServlet(new CamelHttpTransportServlet()); mapping.addUrlMappings("/api/*"); return mapping; }
@Bean ServletRegistrationBean camelServlet() { // use a @Bean to register the Camel servlet which we need to do // because we want to use the camel-servlet component for the Camel REST service ServletRegistrationBean mapping = new ServletRegistrationBean(); mapping.setName("CamelServlet"); mapping.setLoadOnStartup(1); // CamelHttpTransportServlet is the name of the Camel servlet to use mapping.setServlet(new CamelHttpTransportServlet()); mapping.addUrlMappings("/camel/*"); return mapping; }
public static void startServer(String contextDescriptor) { CamelHttpTransportServlet servlet = new CamelHttpTransportServlet(); startServer(servlet, contextDescriptor, false, DEMO_APP_PORT, "CamelServlet"); }
@Bean ServletRegistrationBean servletRegistrationBean(ServletMappingConfiguration config) { ServletRegistrationBean mapping = new ServletRegistrationBean(); mapping.setServlet(new CamelHttpTransportServlet()); mapping.addUrlMappings(config.getContextPath()); mapping.setName(config.getServletName()); mapping.setLoadOnStartup(1); return mapping; }
@Validate public void start() throws ServletException, NamespaceException { CamelHttpTransportServlet srvlet = new CamelHttpTransportServlet(); httpSevlet.registerServlet("/sally", srvlet, null, null); httpSevlet.registerResources("/sally/static", "/static", null); servletComponent = new ServletComponent(); servletComponent.setServletName(srvlet.getServletName()); log.info("SallyURL "+SallyURL+ " "); }
@Validate public void start() throws ServletException, NamespaceException { CamelHttpTransportServlet srvlet = new CamelHttpTransportServlet(); httpSevlet.registerServlet("/sally", srvlet, null, null); httpSevlet.registerResources("/sally/jobad", "/app/jobad", null); httpSevlet.registerResources("/sally/client", "/app/client", null); ServletComponent servletComponent = new ServletComponent(); servletComponent.setServletName(srvlet.getServletName()); camelContextProvider.registerGlobalComponent("sallyservlet", servletComponent); }