コード例 #1
0
ファイル: WebMvcConfig.java プロジェクト: 407435208/platform
 @Bean(name = "captchaServlet")
 public ServletRegistrationBean captchaServlet() {
   ServletRegistrationBean bean = new ServletRegistrationBean();
   bean.setServlet(new CaptchaServlet());
   bean.addUrlMappings("/captcha");
   return bean;
 }
コード例 #2
0
ファイル: Application.java プロジェクト: rgalango/jazz-ws
 // Replaces web.xml
 @Bean
 public ServletRegistrationBean servletRegistrationBean(ApplicationContext context) {
   ServletRegistrationBean servletRegistrationBean =
       new ServletRegistrationBean(new CXFServlet(), "/services/*");
   servletRegistrationBean.setLoadOnStartup(1);
   return servletRegistrationBean;
 }
コード例 #3
0
ファイル: BeanConfig.java プロジェクト: junjies/boot-rest
 @Bean
 public ServletRegistrationBean jaxrsServlet() {
   final JerseySwaggerServlet servlet = new JerseySwaggerServlet();
   final ServletRegistrationBean registrationBean = new ServletRegistrationBean(servlet, "/api/*");
   registrationBean.addInitParameter(JAXRS_APPLICATION_CLASS, JerseyApplication.class.getName());
   return registrationBean;
 }
コード例 #4
0
 @Bean
 public ServletRegistrationBean servletRegistrationBean() {
   CXFServlet cxfServlet = new CXFServlet();
   ServletRegistrationBean servletRegistrationBean =
       new ServletRegistrationBean(cxfServlet, "/soap/*");
   servletRegistrationBean.setLoadOnStartup(1);
   return servletRegistrationBean;
 }
コード例 #5
0
  /**
   * Register dispatcherServlet programmatically
   *
   * @return ServletRegistrationBean
   */
  @Bean
  public ServletRegistrationBean dispatcherServletRegistration() {

    ServletRegistrationBean registration = new ServletRegistrationBean(dispatcherServlet(), "/*");
    registration.setOrder(3);

    registration.setName(
        DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);

    return registration;
  }
コード例 #6
0
  /**
   * 配置Druid Servlet支持监控页面
   *
   * @param ds
   * @return
   */
  @Bean
  public ServletRegistrationBean druidStatView(DruidSettings ds) {

    ServletRegistrationBean registrationBean =
        new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
    Map<String, String> initParameters = new HashMap<>();
    initParameters.put("resetEnable", ds.isResetEnable() + "");
    initParameters.put("loginUsername", ds.getLoginUsername());
    initParameters.put("loginPassword", ds.getLoginPassword());
    registrationBean.setInitParameters(initParameters);
    return registrationBean;
  }
コード例 #7
0
  @Bean
  public ServletRegistrationBean servletRegistrationBean() {
    ServletRegistrationBean result =
        new ServletRegistrationBean(new CGIServlet(), this.cgiPathMapping);

    result.addInitParameter("executable", "");
    result.addInitParameter("cgiPathPrefix", this.cgiPathPrefix);
    result.addInitParameter("parameterEncoding", StandardCharsets.UTF_8.displayName());
    result.addInitParameter("passShellEnvironment", "true");

    return result;
  }
コード例 #8
0
 @Bean
 @ConditionalOnMissingBean(name = "jerseyServletRegistration")
 @ConditionalOnProperty(
     prefix = "spring.jersey",
     name = "type",
     havingValue = "servlet",
     matchIfMissing = true)
 public ServletRegistrationBean jerseyServletRegistration() {
   ServletRegistrationBean registration =
       new ServletRegistrationBean(new ServletContainer(this.config), this.path);
   addInitParameters(registration);
   registration.setName("jerseyServlet");
   return registration;
 }
コード例 #9
0
 @Bean
 ServletRegistrationBean h2servletRegistration() {
   ServletRegistrationBean registrationBean = new ServletRegistrationBean(new WebServlet());
   registrationBean.addUrlMappings("/db/*");
   return registrationBean;
 }