Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
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
spring-boot-admin
Commits
5e9b1eb6
Commit
5e9b1eb6
authored
Jun 26, 2018
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't json serialize the principal
Since the principal not necessarily is json-searializable we need to avoid this and just pass the wanted properties to thymeleaf fixes #799
parent
15c85206
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
UiController.java
...de/codecentric/boot/admin/server/ui/web/UiController.java
+8
-2
No files found.
spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/web/UiController.java
View file @
5e9b1eb6
...
...
@@ -25,6 +25,9 @@ import org.springframework.http.MediaType;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
static
java
.
util
.
Collections
.
emptyMap
;
import
static
java
.
util
.
Collections
.
singletonMap
;
@AdminController
public
class
UiController
{
private
final
String
adminContextPath
;
...
...
@@ -48,8 +51,11 @@ public class UiController {
}
@ModelAttribute
(
value
=
"user"
,
binding
=
false
)
public
Principal
getUiSettings
(
Principal
principal
)
{
return
principal
;
public
Map
<
String
,
Object
>
getUiSettings
(
Principal
principal
)
{
if
(
principal
!=
null
)
{
return
singletonMap
(
"name"
,
principal
.
getName
());
}
return
emptyMap
();
}
@GetMapping
(
path
=
"/"
,
produces
=
MediaType
.
TEXT_HTML_VALUE
)
...
...
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