當前位置: 首頁>>代碼示例>>Java>>正文


Java WebServlet類代碼示例

本文整理匯總了Java中org.h2.server.web.WebServlet的典型用法代碼示例。如果您正苦於以下問題:Java WebServlet類的具體用法?Java WebServlet怎麽用?Java WebServlet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WebServlet類屬於org.h2.server.web包,在下文中一共展示了WebServlet類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: h2servletRegistration

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Bean
ServletRegistrationBean h2servletRegistration()
{
    ServletRegistrationBean registrationBean = new ServletRegistrationBean( new WebServlet());
    registrationBean.addUrlMappings("/console/*");
    return registrationBean;
}
 
開發者ID:Arquisoft,項目名稱:Voting_2b,代碼行數:8,代碼來源:WebConfiguration.java

示例2: testStartUpProdServletContext

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Test
public void testStartUpProdServletContext() throws ServletException {
    env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
    webConfigurer.onStartup(servletContext);

    assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
    assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
    verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
    verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
    verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class));
}
 
開發者ID:xm-online,項目名稱:xm-uaa,代碼行數:12,代碼來源:WebConfigurerTest.java

示例3: testStartUpDevServletContext

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Test
public void testStartUpDevServletContext() throws ServletException {
    env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
    webConfigurer.onStartup(servletContext);

    assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
    assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
    verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
    verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
    verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class));
}
 
開發者ID:xm-online,項目名稱:xm-uaa,代碼行數:12,代碼來源:WebConfigurerTest.java

示例4: testStartUpProdServletContext

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Test
public void testStartUpProdServletContext() throws ServletException {
    env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
    webConfigurer.onStartup(servletContext);

    assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
    assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
    verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
    verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
    verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
    verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class));
}
 
開發者ID:oktadeveloper,項目名稱:jhipster-microservices-example,代碼行數:13,代碼來源:WebConfigurerTest.java

示例5: testStartUpDevServletContext

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Test
public void testStartUpDevServletContext() throws ServletException {
    env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
    webConfigurer.onStartup(servletContext);

    assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry);
    assertThat(servletContext.getAttribute(MetricsServlet.METRICS_REGISTRY)).isEqualTo(metricRegistry);
    verify(servletContext).addFilter(eq("webappMetricsFilter"), any(InstrumentedFilter.class));
    verify(servletContext).addServlet(eq("metricsServlet"), any(MetricsServlet.class));
    verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class));
    verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class));
}
 
開發者ID:oktadeveloper,項目名稱:jhipster-microservices-example,代碼行數:13,代碼來源:WebConfigurerTest.java

示例6: h2servletRegistration

import org.h2.server.web.WebServlet; //導入依賴的package包/類
/**
 * H2 Database Console
 * 
 * @return
 */
@Bean
ServletRegistrationBean h2servletRegistration() {
	ServletRegistrationBean registrationBean = new ServletRegistrationBean(new WebServlet());
	registrationBean.addUrlMappings("/console/*");
	return registrationBean;
}
 
開發者ID:MikeQin,項目名稱:spring-boot-vaadin-rabbitmq-pipeline-demo,代碼行數:12,代碼來源:AppConfig.java

示例7: init

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Override
public void init() {
    super.init();

    try {
        Field field = WebServlet.class.getDeclaredField("server");
        field.setAccessible(true);
        org.h2.server.web.WebServer server = (org.h2.server.web.WebServer) field.get(this);

        ConnectionInfo connectionInfo = new ConnectionInfo("Traccar|"
                + Context.getConfig().getString("database.driver") + "|"
                + Context.getConfig().getString("database.url") + "|"
                + Context.getConfig().getString("database.user"));

        Method method;

        method = org.h2.server.web.WebServer.class.getDeclaredMethod("updateSetting", ConnectionInfo.class);
        method.setAccessible(true);
        method.invoke(server, connectionInfo);

        method = org.h2.server.web.WebServer.class.getDeclaredMethod("setAllowOthers", boolean.class);
        method.setAccessible(true);
        method.invoke(server, true);

    } catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
        Log.warning(e);
    }
}
 
開發者ID:bamartinezd,項目名稱:traccar-service,代碼行數:29,代碼來源:ConsoleServlet.java

示例8: h2servletRegistration

import org.h2.server.web.WebServlet; //導入依賴的package包/類
/**
 * Access the H2 Console:
 * http://localhost:8080/admin/h2/
 * @return
 */
@Bean
public ServletRegistrationBean h2servletRegistration(){
    ServletRegistrationBean registrationBean = new ServletRegistrationBean( new WebServlet());
    registrationBean.addUrlMappings("/admin/h2/*");
    return registrationBean;

}
 
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:13,代碼來源:DataSourceConfig.java

示例9: configureServlets

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Override
protected void configureServlets() {
  if (enabled) {
    filter(H2_PATH, H2_PATH + "/*").through(LeaderRedirectFilter.class);
    serve(H2_PATH, H2_PATH + "/*").with(new WebServlet(), ImmutableMap.of(
        "webAllowOthers", "true",
        "ifExists", "true"
    ));
  }
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Mesos,代碼行數:11,代碼來源:H2ConsoleModule.java

示例10: h2servletRegistration

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Profile("development")
@Bean
ServletRegistrationBean h2servletRegistration() {
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(new WebServlet());
    registrationBean.addUrlMappings("/console/*");
    return registrationBean;
}
 
開發者ID:izhangzhihao,項目名稱:SSMSeedProject,代碼行數:8,代碼來源:WebMvcConfig.java

示例11: h2Console

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Bean
public ServletRegistrationBean h2Console() {
	String path = this.properties.getPath();
	String urlMapping = (path.endsWith("/") ? path + "*" : path + "/*");
	ServletRegistrationBean registration = new ServletRegistrationBean(
			new WebServlet(), urlMapping);
	H2ConsoleProperties.Settings settings = this.properties.getSettings();
	if (settings.isTrace()) {
		registration.addInitParameter("trace", "");
	}
	if (settings.isWebAllowOthers()) {
		registration.addInitParameter("webAllowOthers", "");
	}
	return registration;
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:16,代碼來源:H2ConsoleAutoConfiguration.java

示例12: h2servletRegistration

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Bean
ServletRegistrationBean h2servletRegistration() {
	ServletRegistrationBean registration = new ServletRegistrationBean(new WebServlet());
	registration.addUrlMappings("/console/*");
    registration.addInitParameter("webAllowOthers", "true");
	return registration;
}
 
開發者ID:Manfred73,項目名稱:graphite-monitor-example,代碼行數:8,代碼來源:WebConfiguration.java

示例13: h2servletRegistration

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Bean
@Profile("default")
public ServletRegistrationBean h2servletRegistration() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new WebServlet());
    registration.addUrlMappings("/console/*");
    return registration;
}
 
開發者ID:uc-bd2k,項目名稱:Pilincs,代碼行數:8,代碼來源:Application.java

示例14: h2Servlet

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Bean
public ServletRegistrationBean h2Servlet() {
	ServletRegistrationBean servletBean = new ServletRegistrationBean();
	servletBean.addUrlMappings("/h2/*");
	servletBean.setServlet(new WebServlet());
	return servletBean;
}
 
開發者ID:ralscha,項目名稱:wampspring-demos,代碼行數:8,代碼來源:H2Initializer.java

示例15: h2servletRegistration

import org.h2.server.web.WebServlet; //導入依賴的package包/類
@Bean
public ServletRegistrationBean h2servletRegistration() {
    WebServlet webServlet = new WebServlet();
    ServletRegistrationBean bean = new ServletRegistrationBean(webServlet);
    bean.addUrlMappings("/h2console/*");
    return bean;
}
 
開發者ID:CODINGSAINT,項目名稱:OAuthSpringSSO,代碼行數:8,代碼來源:H2Configuration.java


注:本文中的org.h2.server.web.WebServlet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。