Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
464da4de
Commit
464da4de
authored
Apr 19, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cat bean definition
parent
2c387e32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
CatConfig.java
...in/java/com/ctrip/apollo/common/controller/CatConfig.java
+16
-4
No files found.
apollo-common/src/main/java/com/ctrip/apollo/common/controller/CatConfig.java
View file @
464da4de
package
com
.
ctrip
.
apollo
.
common
.
controller
;
import
javax.servlet.DispatcherType
;
import
org.springframework.boot.context.embedded.FilterRegistrationBean
;
import
org.springframework.boot.context.embedded.ServletListenerRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -10,12 +14,20 @@ import com.dianping.cat.servlet.CatListener;
public
class
CatConfig
{
@Bean
public
CatFilter
catFilter
()
{
return
new
CatFilter
();
public
FilterRegistrationBean
catFilter
()
{
FilterRegistrationBean
bean
=
new
FilterRegistrationBean
();
bean
.
setFilter
(
new
CatFilter
());
bean
.
setName
(
"cat-filter"
);
bean
.
addUrlPatterns
(
"/*"
);
bean
.
setDispatcherTypes
(
DispatcherType
.
REQUEST
,
DispatcherType
.
FORWARD
);
return
bean
;
}
@Bean
public
CatListener
catListener
()
{
return
new
CatListener
();
public
ServletListenerRegistrationBean
<
CatListener
>
catListener
()
{
ServletListenerRegistrationBean
<
CatListener
>
bean
=
new
ServletListenerRegistrationBean
<
CatListener
>(
new
CatListener
());
bean
.
setName
(
"cat-listener"
);
return
bean
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment