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


Java SpringServlet类代码示例

本文整理汇总了Java中com.sun.jersey.spi.spring.container.servlet.SpringServlet的典型用法代码示例。如果您正苦于以下问题:Java SpringServlet类的具体用法?Java SpringServlet怎么用?Java SpringServlet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SpringServlet类属于com.sun.jersey.spi.spring.container.servlet包,在下文中一共展示了SpringServlet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initRestTestServletAdapter

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public static ServletAdapter initRestTestServletAdapter(Class<?> applicationConfigClass, int testServerPort,
		String testContextPath, String testServletPath, boolean enableJPA) {
	final ServletAdapter adapter = new ServletAdapter();
	
	adapter.addInitParameter(ServletContainer.APPLICATION_CONFIG_CLASS, applicationConfigClass.getName());
	adapter.addInitParameter("com.sun.jersey.spi.container.ContainerRequestFilters", LoggingFilter.class.getName());
	adapter.addInitParameter("com.sun.jersey.spi.container.ContainerResponseFilters", LoggingFilter.class.getName());
	
	adapter.addServletListener(ContextLoaderListener.class.getName());
	
	if (enableJPA) {
		adapter.addFilter(new OpenEntityManagerInViewFilter(), "openEntityManagerInViewFilter", null);
	}
	
	adapter.setServletInstance(new SpringServlet());
	adapter.setContextPath(testContextPath);
	adapter.setServletPath(testServletPath);
	
	return adapter;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:21,代码来源:RestTestUtils.java

示例2: setUp

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
@Before
public void setUp() throws Throwable {
    beforeServletStart();

    setServletContext(new MockServletContext("file:src/main/webapp"));

    getServletContext().addInitParameter("contextConfigLocation", "file:src/main/resources/META-INF/opennms/component-service.xml");

    getServletContext().addInitParameter("parentContextKey", "testDaoContext");

            
    ServletContextEvent e = new ServletContextEvent(getServletContext());
    setContextListener(new ContextLoaderListener());
    getContextListener().contextInitialized(e);

    getServletContext().setContextPath(contextPath);
    setServletConfig(new MockServletConfig(getServletContext(), "dispatcher"));
    /*
    getServletConfig().addInitParameter("com.sun.jersey.config.property.resourceConfigClass", "com.sun.jersey.api.core.PackagesResourceConfig");
    getServletConfig().addInitParameter("com.sun.jersey.config.property.packages", "org.opennms.netmgt.ncs.rest");
    */
    try {

        MockFilterConfig filterConfig = new MockFilterConfig(getServletContext(), "openSessionInViewFilter");
        setFilter(new OpenSessionInViewFilter());        
        getFilter().init(filterConfig);

        setDispatcher(new SpringServlet());
        getDispatcher().init(getServletConfig());

    } catch (ServletException se) {
        throw se.getRootCause();
    }
    
    setWebAppContext(WebApplicationContextUtils.getWebApplicationContext(getServletContext()));
    afterServletStart();
    System.err.println("------------------------------------------------------------------------------");
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:39,代码来源:AbstractSpringJerseyRestTestCase.java

示例3: DeleteSorPersonViaRestResourceTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public DeleteSorPersonViaRestResourceTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testDELETE-SORPersonViaRESTApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:DeleteSorPersonViaRestResourceTests.java

示例4: ActivationKeyProcessorResourceTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public ActivationKeyProcessorResourceTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources.activation")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:ActivationKeyProcessorResourceTests.java

示例5: ActivationKeyFactoryResourceTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public ActivationKeyFactoryResourceTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources.activation")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:ActivationKeyFactoryResourceTests.java

示例6: PostNewPersonToPeopleResourceTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public PostNewPersonToPeopleResourceTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testPOSTPersonViaRESTApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:PostNewPersonToPeopleResourceTests.java

示例7: PostLinkSorPersonViaRestResourceTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public PostLinkSorPersonViaRestResourceTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testPOSTLinkSorPersonViaRESTApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:PostLinkSorPersonViaRestResourceTests.java

示例8: UpdateSorRoleTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public UpdateSorRoleTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testPUT-SORRoleViaRESTApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:UpdateSorRoleTests.java

示例9: ProcessEmailResourceTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public ProcessEmailResourceTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testPOSTEmailViaRESTApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:ProcessEmailResourceTests.java

示例10: UpdateSorPersonTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public UpdateSorPersonTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testPUT-SORPersonViaRESTApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:UpdateSorPersonTests.java

示例11: DeleteSorRoleViaRestResourceTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public DeleteSorRoleViaRestResourceTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testDELETE-SORRoleViaRESTApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:DeleteSorRoleViaRestResourceTests.java

示例12: IdCardResourceTests

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public IdCardResourceTests() {
    super(new WebAppDescriptor.Builder("org.openregistry.core.web.resources")
            .contextPath("openregistry")
            .contextParam("contextConfigLocation", "classpath:testIdCardResourceApplicationContext.xml")
            .servletClass(SpringServlet.class)
            .contextListenerClass(ContextLoaderListener.class)
            .build());
}
 
开发者ID:Jasig,项目名称:openregistry,代码行数:9,代码来源:IdCardResourceTests.java

示例13: TestMetadata

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public TestMetadata() {
    super(new WebAppDescriptor.Builder("org.fao.faostat.api.web.rest").contextPath("testing")
            .contextParam("contextConfigLocation", "classpath:testApplicationContext.xml")
            .contextListenerClass(ContextLoaderListener.class).servletClass(SpringServlet.class)
            .requestListenerClass(RequestContextListener.class).build());
}
 
开发者ID:FAOSTAT,项目名称:faostat-api,代码行数:7,代码来源:TestMetadata.java

示例14: TestDimensions

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public TestDimensions() {
    super(new WebAppDescriptor.Builder("org.fao.faostat.api.web.rest").contextPath("testing")
            .contextParam("contextConfigLocation", "classpath:testApplicationContext.xml")
            .contextListenerClass(ContextLoaderListener.class).servletClass(SpringServlet.class)
            .requestListenerClass(RequestContextListener.class).build());
}
 
开发者ID:FAOSTAT,项目名称:faostat-api,代码行数:7,代码来源:TestDimensions.java

示例15: TestData

import com.sun.jersey.spi.spring.container.servlet.SpringServlet; //导入依赖的package包/类
public TestData() {
    super(new WebAppDescriptor.Builder("org.fao.faostat.api.web.rest").contextPath("testing")
            .contextParam("contextConfigLocation", "classpath:testApplicationContext.xml")
            .contextListenerClass(ContextLoaderListener.class).servletClass(SpringServlet.class)
            .requestListenerClass(RequestContextListener.class).build());
}
 
开发者ID:FAOSTAT,项目名称:faostat-api,代码行数:7,代码来源:TestData.java


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