Upgrade samples to Boot 2.0.0.M1

Fixes gh-782
This commit is contained in:
Vedran Pavic
2017-05-24 23:18:30 +02:00
parent 22f4b0bc9d
commit 79f187ddd6
26 changed files with 37 additions and 330 deletions

View File

@@ -18,10 +18,10 @@ package sample.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
public class WebMvcConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {

View File

@@ -18,7 +18,6 @@ package sample.websocket;
import java.util.Arrays;
import sample.data.ActiveWebSocketUser;
import sample.data.ActiveWebSocketUserRepository;
import org.springframework.context.ApplicationListener;
@@ -42,14 +41,10 @@ public class WebSocketDisconnectHandler<S>
if (id == null) {
return;
}
ActiveWebSocketUser user = this.repository.findOne(id);
if (user == null) {
return;
}
this.repository.delete(id);
this.messagingTemplate.convertAndSend("/topic/friends/signout",
Arrays.asList(user.getUsername()));
this.repository.findById(id).ifPresent(user -> {
this.repository.deleteById(id);
this.messagingTemplate.convertAndSend("/topic/friends/signout",
Arrays.asList(user.getUsername()));
});
}
}

View File

@@ -1,4 +1,4 @@
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="layout">
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout}">
<head>
<title>View All</title>
</head>

View File

@@ -3,7 +3,7 @@
xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<title layout:title-pattern="$DECORATOR_TITLE - $CONTENT_TITLE">Spring Session Sample</title>
<title layout:title-pattern="$LAYOUT_TITLE - $CONTENT_TITLE">Spring Session Sample</title>
<link rel="icon" type="image/x-icon" th:href="@{/favicon.ico}" href="../static/favicon.ico"/>
<link th:href="@{/webjars/bootstrap/css/bootstrap.min.css}" href="/webjars/bootstrap/css/bootstrap.min.css" rel="stylesheet"></link>
<style type="text/css">