本文整理汇总了Java中com.sun.jersey.spi.container.servlet.WebConfig类的典型用法代码示例。如果您正苦于以下问题:Java WebConfig类的具体用法?Java WebConfig怎么用?Java WebConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebConfig类属于com.sun.jersey.spi.container.servlet包,在下文中一共展示了WebConfig类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaultResourceConfig
import com.sun.jersey.spi.container.servlet.WebConfig; //导入依赖的package包/类
@Override
protected ResourceConfig getDefaultResourceConfig(Map<String, Object> props,
WebConfig webConfig) throws ServletException {
HashMap<String, Object> mergedProps = new HashMap<>(props);
mergedProps.putAll(this.props);
return new PackagesResourceConfig(mergedProps) {
@Override
public Set<Class<?>> getProviderClasses() {
Set<Class<?>> providers = super.getProviderClasses();
// remove conflicting provider if present
providers.remove(FreemarkerTemplateProvider.class);
providers.add(AdminFreemarkerTemplateProvider.class);
providers.add(WebApplicationExceptionMapper.class);
return providers;
}
};
}
示例2: getDefaultResourceConfig
import com.sun.jersey.spi.container.servlet.WebConfig; //导入依赖的package包/类
@Override
protected ResourceConfig getDefaultResourceConfig(Map<String, Object> props, WebConfig webConfig) throws ServletException {
DefaultResourceConfig cfg = new DefaultResourceConfig();
if (props.containsKey(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS) == false) {
props.put(ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS, new ArrayList<Object>(Arrays.asList(new HttpMethodFilter(), new UrlSuffixFilter())));
}
if (props.containsKey(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS) == false) {
props.put(ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS, new ArrayList<Object>(Arrays.asList(new NoCachingFilter())));
}
cfg.setPropertiesAndFeatures(props);
return cfg;
}
示例3: configure
import com.sun.jersey.spi.container.servlet.WebConfig; //导入依赖的package包/类
@Override
protected void configure(WebConfig wc,
ResourceConfig rc,
WebApplication wa) {
super.configure(wc, rc, wa);
Set<Object> singletons = rc.getSingletons();
singletons.add(new WebAppApiProvider());
}
示例4: getDefaultResourceConfig
import com.sun.jersey.spi.container.servlet.WebConfig; //导入依赖的package包/类
@Override
protected ResourceConfig getDefaultResourceConfig(Map<String, Object> props, WebConfig webConfig) throws ServletException {
return resourceConfig;
}
示例5: getDefaultResourceConfig
import com.sun.jersey.spi.container.servlet.WebConfig; //导入依赖的package包/类
@Override
protected ResourceConfig getDefaultResourceConfig(Map<String, Object> properties, WebConfig webConfig)
throws ServletException {
return new DefaultResourceConfig();
}
示例6: getDefaultResourceConfig
import com.sun.jersey.spi.container.servlet.WebConfig; //导入依赖的package包/类
@Override
public ResourceConfig getDefaultResourceConfig(Map<String, Object> props, WebConfig webConfig) {
return environment.getJerseyResourceConfig();
}