package io.khasang.wlogs.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class AppController {
    @RequestMapping("/")
    public String welcome(Model model) {
        model.addAttribute("greeting", "Welcome to our best wLogs!");
        model.addAttribute("tagline", "The one and only amazing logs system!");
        return "welcome";
    }

    @RequestMapping("/backup")
    public String backup(Model model) {
        model.addAttribute("backup", "Success");
        return "backup";
    }

    @RequestMapping("/admin")
    public String admin(Model model) {
        model.addAttribute("admin", "You are number 1!");
        return "admin";
    }
}
@@ -31,16 +31,101 @@
 oller;%0A%0A
+import io.khasang.wlogs.model.DbModel;%0Aimport io.khasang.wlogs.model.TestTableModel;%0A
 import o
@@ -267,16 +267,129 @@
 pping;%0A%0A
+import java.sql.ResultSet;%0Aimport java.sql.SQLException;%0Aimport java.sql.Statement;%0Aimport java.util.ArrayList;%0A%0A
 @Control
@@ -978,10 +978,1611 @@
 %22;%0A    %7D
+%0A%0A    @RequestMapping(%22/table%22)%0A    public String table(Model model) %7B%0A        model.addAttribute(%22table%22, %22You have one table!%22);%0A        Statement statement = new DbModel().getStatement();%0A        String sql = %22select * from tableTest%22;%0A        ResultSet resultSet = null;%0A        ArrayList%3CTestTableModel%3E testTableModelArrayList = null;%0A        try %7B%0A            if (statement != null) %7B%0A                resultSet = statement.executeQuery(sql);%0A            %7D%0A            else %7B%0A                model.addAttribute(%22error%22, %22%D0%9E%D1%88%D0%B8%D0%B1%D0%BA%D0%B0: %D0%BD%D0%B5%D1%82 %D1%81%D0%BE%D0%B5%D0%B4%D0%B8%D0%BD%D0%B5%D0%BD%D0%B8%D1%8F %D1%81 %D0%B1%D0%B0%D0%B7%D0%BE%D0%B9%22);%0A            %7D%0A            if (resultSet != null) %7B%0A                testTableModelArrayList = new ArrayList%3CTestTableModel%3E(resultSet.getFetchSize());%0A                while (resultSet.next()) %7B%0A                    TestTableModel testTableModel = new TestTableModel();%0A                    testTableModel.setServer(resultSet.getString(TestTableModel.tableFiled.server.toString()));%0A                    testTableModel.setComment(resultSet.getString(TestTableModel.tableFiled.comment.toString()));%0A                    testTableModel.setDate(resultSet.getString(TestTableModel.tableFiled.date.toString()));%0A                    testTableModel.setIssue(resultSet.getString(TestTableModel.tableFiled.issue.toString()));%0A                    testTableModelArrayList.add(testTableModel);%0A                %7D%0A            %7D%0A        %7D catch (SQLException e) %7B%0A            //e.printStackTrace();%0A            model.addAttribute(%22error%22, %22%D0%9E%D1%88%D0%B8%D0%B1%D0%BA%D0%B0: %22 + e);%0A        %7D%0A        model.addAttribute(%22listTable%22, testTableModelArrayList);%0A        return %22table%22;%0A    %7D
 %0A%7D

add table.jsp