This repository was archived by the owner on Oct 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 868
Expand file tree
/
Copy pathapplicationContext.xml
More file actions
77 lines (65 loc) · 3.19 KB
/
applicationContext.xml
File metadata and controls
77 lines (65 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://cxf.apache.org/core"
xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<context:component-scan base-package="io.swagger.sample" />
<!-- Swagger writers -->
<bean id="swaggerWriter" class="io.swagger.jaxrs.listing.SwaggerSerializers" />
<!-- <bean id="apiWriter" class="io.swagger.jaxrs.listing.ApiDeclarationProvider" /> -->
<!-- JSON mapper -->
<bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider" />
<!-- Exception mapper -->
<bean id="exceptionMapper" class="io.swagger.sample.resource.SampleExceptionMapper" />
<!-- Application resources -->
<bean id="userResource" class="io.swagger.sample.resource.UserResource" />
<bean id="petResource" class="io.swagger.sample.resource.PetResource" />
<bean id="petStoreResource" class="io.swagger.sample.resource.PetStoreResource" />
<!-- Swagger API listing resource -->
<bean id="swaggerResource" class="io.swagger.jaxrs.listing.ApiListingResource" />
<cxf:bus>
<cxf:features>
<cxf:logging />
</cxf:features>
</cxf:bus>
<!-- this scans the classes for resources -->
<bean id="swaggerConfig" class="io.swagger.jaxrs.config.BeanConfig">
<property name="resourcePackage" value="io.swagger.sample.resource"/>
<property name="version" value="1.0.0"/>
<property name="host" value="localhost:8002"/>
<property name="basePath" value="/api"/>
<property name="title" value="Swagger Petstore"/>
<property name="description" value="This is a app."/>
<property name="contact" value="apiteam@swagger.io"/>
<property name="license" value="Apache 2.0"/>
<property name="licenseUrl" value="http://www.apache.org/licenses/LICENSE-2.0.html"/>
<!-- <property name="filterClass" value="ApiAuthorizationFilterImpl"/> -->
<property name="scan" value="true"/>
</bean>
<bean class="org.apache.cxf.jaxrs.JAXRSServerFactoryBean" init-method="create">
<property name="address" value="/" />
<property name="serviceBeans">
<list>
<ref bean="userResource" />
<ref bean="petResource" />
<ref bean="petStoreResource" />
<ref bean="swaggerResource" />
</list>
</property>
<property name="providers">
<list>
<ref bean="jsonProvider" />
<ref bean="swaggerWriter" />
<ref bean="exceptionMapper" />
<!-- required for writing swagger classes -->
<!-- <ref bean="resourceWriter" />
<ref bean="apiWriter" /> -->
</list>
</property>
</bean>
</beans>