Skip to content

Commit ae8b2e8

Browse files
author
Łukasz Polatowski
committed
Movie list na Webie
1 parent fbfb235 commit ae8b2e8

File tree

5 files changed

+48
-39
lines changed

5 files changed

+48
-39
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.Polodz.webController;
2+
3+
import com.Polodz.service.WebService;
4+
import org.springframework.beans.factory.annotation.Autowired;
5+
import org.springframework.stereotype.Controller;
6+
import org.springframework.web.bind.annotation.GetMapping;
7+
import org.springframework.web.servlet.ModelAndView;
8+
9+
/**
10+
* Created by lpolatowski on 2016-09-07.
11+
*/
12+
13+
@Controller
14+
public class WebMovieListController {
15+
16+
@Autowired
17+
private WebService service;
18+
19+
@GetMapping("/movieList")
20+
public ModelAndView getMovieList() {
21+
return new ModelAndView("movieList").addObject("string", service.getMovieListString());
22+
}
23+
24+
}

src/main/java/com/Polodz/controller/WebMovieListController.java

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.Polodz.service;
2+
3+
import org.springframework.stereotype.Service;
4+
5+
/**
6+
* Created by lpolatowski on 2016-09-07.
7+
*/
8+
@Service
9+
public class WebService {
10+
11+
private static String movieListString;
12+
13+
public String getMovieListString() {
14+
return movieListString;
15+
}
16+
17+
public static void setMovieListString(String value) {
18+
movieListString = value;
19+
}
20+
21+
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE HTML>
22
<html xmlns:th="http://www.thymeleaf.org">
33
<head>
4-
<title>Getting Started: Handling Form Submission</title>
5-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
4+
<title>Movie List</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
66
</head>
77
<body>
8-
<p th:text="${stringgg.content}" />
8+
<p th:text="${string}"></p>
99
</body>
1010
</html>

src/main/resources/templates/stringForm.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)