Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IA2
GMS
Commits
d9c5b66f
Commit
d9c5b66f
authored
Oct 13, 2020
by
Sonia Zorba
Browse files
LoggingDAO bugfix
parent
fd37936e
Changes
1
Hide whitespace changes
Inline
Side-by-side
gms/src/main/java/it/inaf/ia2/gms/persistence/LoggingDAO.java
View file @
d9c5b66f
...
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.BeanCreationException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -51,7 +52,7 @@ public class LoggingDAO {
...
@@ -51,7 +52,7 @@ public class LoggingDAO {
private
String
getStackTraceString
(
Exception
ex
)
{
private
String
getStackTraceString
(
Exception
ex
)
{
StringWriter
sw
=
new
StringWriter
();
StringWriter
sw
=
new
StringWriter
();
try
(
PrintWriter
pw
=
new
PrintWriter
(
sw
))
{
try
(
PrintWriter
pw
=
new
PrintWriter
(
sw
))
{
ex
.
printStackTrace
(
pw
);
ex
.
printStackTrace
(
pw
);
}
}
return
sw
.
toString
();
return
sw
.
toString
();
...
@@ -91,9 +92,11 @@ public class LoggingDAO {
...
@@ -91,9 +92,11 @@ public class LoggingDAO {
if
(
request
.
getUserPrincipal
()
!=
null
&&
request
.
getUserPrincipal
()
instanceof
RapPrincipal
)
{
if
(
request
.
getUserPrincipal
()
!=
null
&&
request
.
getUserPrincipal
()
instanceof
RapPrincipal
)
{
return
request
.
getUserPrincipal
().
getName
();
return
request
.
getUserPrincipal
().
getName
();
}
else
if
(
request
.
getSession
(
false
)
!=
null
)
{
}
else
if
(
request
.
getSession
(
false
)
!=
null
)
{
return
sessionData
.
getUserId
();
try
{
}
else
{
return
sessionData
.
getUserId
();
return
null
;
}
catch
(
BeanCreationException
ex
)
{
}
}
}
return
null
;
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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