本文整理汇总了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;
}
示例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("------------------------------------------------------------------------------");
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}