Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
solo
Commits
c33b3a10
Commit
c33b3a10
authored
Dec 05, 2015
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init info just logging once
parent
2119ca85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
src/main/java/org/b3log/solo/filter/InitCheckFilter.java
src/main/java/org/b3log/solo/filter/InitCheckFilter.java
+15
-7
No files found.
src/main/java/org/b3log/solo/filter/InitCheckFilter.java
View file @
c33b3a10
...
...
@@ -15,7 +15,6 @@
*/
package
org
.
b3log
.
solo
.
filter
;
import
java.io.IOException
;
import
javax.servlet.Filter
;
import
javax.servlet.FilterChain
;
...
...
@@ -38,12 +37,11 @@ import org.b3log.latke.servlet.HttpControl;
import
org.b3log.latke.servlet.renderer.HTTP500Renderer
;
import
org.b3log.solo.service.InitService
;
/**
* Checks initialization filter.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.
0.1.1, Sep 10, 2013
* @version 1.
1.1.1, Dec 5, 2015
* @since 0.3.1
*/
public
final
class
InitCheckFilter
implements
Filter
{
...
...
@@ -53,8 +51,14 @@ public final class InitCheckFilter implements Filter {
*/
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
InitCheckFilter
.
class
.
getName
());
/**
* Whether initialization info reported.
*/
private
static
boolean
initReported
;
@Override
public
void
init
(
final
FilterConfig
filterConfig
)
throws
ServletException
{}
public
void
init
(
final
FilterConfig
filterConfig
)
throws
ServletException
{
}
/**
* If Solo has not been initialized, so redirects to /init.
...
...
@@ -67,7 +71,7 @@ public final class InitCheckFilter implements Filter {
*/
@Override
public
void
doFilter
(
final
ServletRequest
request
,
final
ServletResponse
response
,
final
FilterChain
chain
)
throws
IOException
,
ServletException
{
throws
IOException
,
ServletException
{
final
HttpServletRequest
httpServletRequest
=
(
HttpServletRequest
)
request
;
final
String
requestURI
=
httpServletRequest
.
getRequestURI
();
...
...
@@ -96,7 +100,10 @@ public final class InitCheckFilter implements Filter {
return
;
}
LOGGER
.
log
(
Level
.
INFO
,
"Solo has not been initialized, so redirects to /init"
);
if
(!
initReported
)
{
LOGGER
.
log
(
Level
.
INFO
,
"Solo has not been initialized, so redirects to /init"
);
initReported
=
true
;
}
final
HTTPRequestContext
context
=
new
HTTPRequestContext
();
...
...
@@ -118,5 +125,6 @@ public final class InitCheckFilter implements Filter {
}
@Override
public
void
destroy
()
{}
public
void
destroy
()
{
}
}
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