From 966565323490c8d88729bde0891b9d70319a40af Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 21 Nov 2019 10:54:48 +0400 Subject: [PATCH] show paper list --- .../ru/ulstu/paper/controller/PaperView.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/java/ru/ulstu/paper/controller/PaperView.java diff --git a/src/main/java/ru/ulstu/paper/controller/PaperView.java b/src/main/java/ru/ulstu/paper/controller/PaperView.java new file mode 100644 index 0000000..54f802f --- /dev/null +++ b/src/main/java/ru/ulstu/paper/controller/PaperView.java @@ -0,0 +1,28 @@ +package ru.ulstu.paper.controller; + +import ru.ulstu.paper.model.Paper; +import ru.ulstu.paper.service.PaperService; + +import javax.annotation.PostConstruct; +import javax.faces.view.ViewScoped; +import javax.inject.Inject; +import javax.inject.Named; +import java.util.List; + +@Named +@ViewScoped +public class PaperView { + @Inject + private PaperService paperService; + + private List papers; + + @PostConstruct + public void init() { + papers = paperService.findAll(); + } + + public List getPapers() { + return papers; + } +}