Skip to content

Commit 2999355

Browse files
phasenraum2010phasenraum2010
authored andcommitted
JPA with PostgreSQL
1 parent b110d0f commit 2999355

File tree

3 files changed

+26
-27
lines changed

3 files changed

+26
-27
lines changed

src/main/java/org/woehlke/learn/learnneo4j/components/db/PortinfoController.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,23 @@
66
import org.springframework.stereotype.Controller;
77
import org.springframework.ui.Model;
88
import org.springframework.web.bind.annotation.GetMapping;
9-
import org.springframework.web.bind.annotation.ModelAttribute;
109
import org.springframework.web.bind.annotation.RequestMapping;
11-
import org.woehlke.learn.learnneo4j.model.platform.PlatformController;
1210

1311
@Controller
14-
@RequestMapping("/db/Portinfo")
12+
@RequestMapping("/db/portinfo")
1513
public class PortinfoController {
1614

17-
private static Logger log = LoggerFactory.getLogger(PlatformController.class.getName());
15+
private static Logger log = LoggerFactory.getLogger(PortinfoController.class.getName());
1816

19-
@ModelAttribute("title")
20-
public String getTitle(){
21-
return "Portinfo";
22-
}
17+
//@ModelAttribute("title")
18+
//public String getTitle(){
19+
// return "Portinfo";
20+
//}
2321

2422
@GetMapping("/all")
2523
public String greeting(Model model) {
2624
model.addAttribute("all", portinfoService.findAll());
25+
model.addAttribute("title","Portinfo");
2726
log.info("db/portinfo/all");
2827
return "db/portinfo/all";
2928
}

src/main/java/org/woehlke/learn/learnneo4j/components/home/HomeController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import org.springframework.stereotype.Controller;
55
import org.springframework.ui.Model;
66
import org.springframework.web.bind.annotation.GetMapping;
7-
import org.springframework.web.bind.annotation.ModelAttribute;
87
import org.springframework.web.bind.annotation.RequestParam;
98

109
@Controller
@@ -29,13 +28,14 @@ public String greeting(@RequestParam(name="name", required=false, defaultValue="
2928
}
3029

3130
@GetMapping("/home")
32-
public String home() {
31+
public String home(Model model) {
32+
model.addAttribute("title","Home");
3333
return "home";
3434
}
3535

36-
@ModelAttribute("title")
37-
public String getTitle(){
38-
return "Home";
39-
}
36+
// @ModelAttribute("title")
37+
// public String getTitle(){
38+
// return "Home";
39+
//}
4040

4141
}

src/main/resources/templates/node/license/all.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
<title th:replace="${title}">Nodes</title>
55
</head>
66
<body th:insert="template :: tw_body">
7-
8-
<div class="container" th:replace="template :: tw_main_app">
9-
<!-- Example row of columns -->
10-
<div class="row">
11-
<div class="col-md-12">
12-
<h2>All Licenses:</h2>
13-
<hr/>
14-
<ul th:each="item : ${all}">
15-
<li th:text="${item.name}" />
16-
</ul>
7+
<main role="main" th:insert="template :: tw_main">
8+
<div class="container" th:replace="template :: tw_main_app">
9+
<!-- Example row of columns -->
10+
<div class="row">
11+
<div class="col-md-12">
12+
<h2>All Licenses:</h2>
13+
<hr/>
14+
<ul th:each="item : ${all}">
15+
<li th:text="${item.name}" />
16+
</ul>
17+
</div>
18+
</div>
1719
</div>
18-
</div>
19-
</div>
20-
20+
</main>
2121
</body>
2222
</html>

0 commit comments

Comments
 (0)