Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
Overview
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
gechengyang
nouiWithSpringMVC
Commits
590e6ba8
Commit
590e6ba8
authored
Jun 25, 2019
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持不限超时的情况
parent
69e4d0ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
NoUiApiInitListener.java
...g/sss/presentation/noui/listener/NoUiApiInitListener.java
+7
-1
RedisUtil.java
src/main/java/org/sss/presentation/noui/util/RedisUtil.java
+5
-1
No files found.
src/main/java/org/sss/presentation/noui/listener/NoUiApiInitListener.java
View file @
590e6ba8
...
@@ -9,6 +9,7 @@ import javax.servlet.ServletContextListener;
...
@@ -9,6 +9,7 @@ import javax.servlet.ServletContextListener;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.sss.presentation.noui.context.NoUiContextManager
;
import
org.sss.presentation.noui.context.NoUiContextManager
;
import
org.sss.presentation.noui.util.RedisUtil
;
import
log.Log
;
import
log.Log
;
import
log.LogFactory
;
import
log.LogFactory
;
...
@@ -33,7 +34,12 @@ public class NoUiApiInitListener implements ServletContextListener {
...
@@ -33,7 +34,12 @@ public class NoUiApiInitListener implements ServletContextListener {
public
void
contextInitialized
(
ServletContextEvent
contextEvent
)
{
public
void
contextInitialized
(
ServletContextEvent
contextEvent
)
{
ServletContext
context
=
contextEvent
.
getServletContext
();
ServletContext
context
=
contextEvent
.
getServletContext
();
String
dbType
=
context
.
getInitParameter
(
DATABASE_SUPPORT_TYPE
);
String
dbType
=
context
.
getInitParameter
(
DATABASE_SUPPORT_TYPE
);
int
timeout
=
Integer
.
valueOf
(
context
.
getInitParameter
(
NOUI_TIMEOUT
));
int
timeout
=
Integer
.
valueOf
(
context
.
getInitParameter
(
NOUI_TIMEOUT
));
//秒数
if
(
timeout
>
0
)
RedisUtil
.
setSessionTimeOut
(
timeout
);
else
RedisUtil
.
setSessionTimeOut
(
3
*
30
*
24
*
60
*
60
);
//一个月
NoUiContextManager
.
dbType
=
dbType
;
NoUiContextManager
.
dbType
=
dbType
;
NoUiContextManager
.
loginContextName
=
context
.
getInitParameter
(
LOGIN_CONTEXT_NAME
);
NoUiContextManager
.
loginContextName
=
context
.
getInitParameter
(
LOGIN_CONTEXT_NAME
);
String
openSource
=
context
.
getInitParameter
(
OPEN_PREFIX
);
String
openSource
=
context
.
getInitParameter
(
OPEN_PREFIX
);
...
...
src/main/java/org/sss/presentation/noui/util/RedisUtil.java
View file @
590e6ba8
...
@@ -20,7 +20,11 @@ public class RedisUtil {
...
@@ -20,7 +20,11 @@ public class RedisUtil {
static
{
static
{
initialPool
();
initialPool
();
}
}
public
static
void
setSessionTimeOut
(
int
time
){
sessionTimeOut
=
time
;
}
public
static
int
getSessionTimeOut
()
{
public
static
int
getSessionTimeOut
()
{
return
sessionTimeOut
;
return
sessionTimeOut
;
}
}
...
...
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