当前位置: 首页>>代码示例>>Java>>正文


Java Dynamic.setInitParameter方法代码示例

本文整理汇总了Java中javax.servlet.ServletRegistration.Dynamic.setInitParameter方法的典型用法代码示例。如果您正苦于以下问题:Java Dynamic.setInitParameter方法的具体用法?Java Dynamic.setInitParameter怎么用?Java Dynamic.setInitParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.ServletRegistration.Dynamic的用法示例。


在下文中一共展示了Dynamic.setInitParameter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initGitServlet

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
private void initGitServlet(Path gitWorkspace, ServletContext servletContext) throws IOException {
    if (!Files.exists(gitWorkspace)) {
        Files.createDirectories(gitWorkspace);
    }

    // add git servlet mapping
    Dynamic gitServlet = servletContext.addServlet("git-servlet", new GitServlet());
    gitServlet.addMapping("/git/*");
    gitServlet.setInitParameter("base-path", gitWorkspace.toString());
    gitServlet.setInitParameter("export-all", "true");
    gitServlet.setAsyncSupported(true);
    gitServlet.setLoadOnStartup(1);
}
 
开发者ID:FlowCI,项目名称:flow-platform,代码行数:14,代码来源:AppInit.java

示例2: registerCXFServlet

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
private static void registerCXFServlet(ServletContext servletContext) {
	LOGGER.info("Registering CXF servlet...");
	Dynamic dynamic =
		servletContext.
			addServlet(
				"LDP4jFrontendServerServlet",
				"org.apache.cxf.transport.servlet.CXFServlet");
	dynamic.addMapping("/*");
	/** See https://issues.apache.org/jira/browse/CXF-5068 */
	dynamic.setInitParameter("disable-address-updates","true");
	/** Required for testing */
	dynamic.setInitParameter("static-welcome-file","/index.html");
	dynamic.setInitParameter("static-resources-list","/index.html");
	dynamic.setLoadOnStartup(1);
	LOGGER.info("CXF servlet registered.");
}
 
开发者ID:ldp4j,项目名称:ldp4j,代码行数:17,代码来源:BootstrapContextListener.java

示例3: contextInitialized

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent sce) {
    ServletContext ctx = sce.getServletContext();
    Dynamic servlet = ctx.addServlet("jersey", ServletContainer.class);
    servlet.addMapping("/*");
    servlet.setInitParameter("jersey.config.server.provider.classnames", TestServiceImpl.class.getName());

    FilterRegistration.Dynamic filter = ctx.addFilter("origin", CrossOriginFilter.class);
    filter.setInitParameter("allowedMethods", "GET,POST,PUT,DELETE");
    filter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
}
 
开发者ID:konsoletyper,项目名称:teavm-flavour,代码行数:12,代码来源:RESTContextListener.java

示例4: customizeRegistration

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
protected void customizeRegistration(Dynamic registration) {

	MultipartConfigElement multipartConfigElement = new MultipartConfigElement("");

	registration.setMultipartConfig(multipartConfigElement);
	registration.setInitParameter("dispatchOptionsRequest", "true");
	registration.setAsyncSupported(true);
}
 
开发者ID:digitalfondue,项目名称:lavagna,代码行数:10,代码来源:DispatcherServletInitializer.java

示例5: customizeRegistration

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
protected void customizeRegistration(Dynamic registration) {
    registration.setInitParameter("throwExceptionIfNoHandlerFound", "true");
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:5,代码来源:RegistryAppInitializer.java

示例6: customizeRegistration

import javax.servlet.ServletRegistration.Dynamic; //导入方法依赖的package包/类
@Override
protected void customizeRegistration(Dynamic registration) {
	registration.setInitParameter("dispatchOptionsRequest", "true");
	registration.setAsyncSupported(true);
}
 
开发者ID:wieden-kennedy,项目名称:composite-framework,代码行数:6,代码来源:Initializer.java


注:本文中的javax.servlet.ServletRegistration.Dynamic.setInitParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。