#8 -- Add router component. You can access to url's in mvc controllers also in web page templates.
This commit is contained in:
parent
e348b37625
commit
33bf0bd8f3
@ -1,3 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
* You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
*/
|
||||||
|
|
||||||
package ru.ulstu.extractor.config;
|
package ru.ulstu.extractor.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@ -5,12 +10,14 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
|
|||||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
import static ru.ulstu.extractor.controller.Route.LIST_INDEXED_REPOSITORIES;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class MvcConfiguration implements WebMvcConfigurer {
|
public class MvcConfiguration implements WebMvcConfigurer {
|
||||||
@Override
|
@Override
|
||||||
public void addViewControllers(ViewControllerRegistry registry) {
|
public void addViewControllers(ViewControllerRegistry registry) {
|
||||||
registry.addViewController("/{articlename:\\w+}");
|
registry.addViewController("/{articlename:\\w+}");
|
||||||
registry.addRedirectViewController("/", "/newRepo");
|
registry.addRedirectViewController("/", LIST_INDEXED_REPOSITORIES);
|
||||||
registry.addRedirectViewController("/default", "/home");
|
registry.addRedirectViewController("/default", "/home");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
* You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
*/
|
||||||
|
|
||||||
package ru.ulstu.extractor.controller;
|
package ru.ulstu.extractor.controller;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@ -7,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import ru.ulstu.extractor.repository.BranchRepository;
|
import ru.ulstu.extractor.repository.BranchRepository;
|
||||||
import ru.ulstu.extractor.repository.RepositoryRepository;
|
import ru.ulstu.extractor.repository.RepositoryRepository;
|
||||||
|
|
||||||
|
import static ru.ulstu.extractor.controller.Route.LIST_REPOSITORY_BRANCHES;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class BranchController {
|
public class BranchController {
|
||||||
private final RepositoryRepository repositoryRepository;
|
private final RepositoryRepository repositoryRepository;
|
||||||
@ -17,12 +24,12 @@ public class BranchController {
|
|||||||
this.branchRepository = branchRepository;
|
this.branchRepository = branchRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/details")
|
@GetMapping(LIST_REPOSITORY_BRANCHES)
|
||||||
public String indexBranch(
|
public String indexBranch(
|
||||||
Model model,
|
Model model,
|
||||||
@RequestParam int repositoryId) {
|
@RequestParam int repositoryId) {
|
||||||
model.addAttribute("branches", branchRepository.findByRepositoryId(repositoryId));
|
model.addAttribute("branches", branchRepository.findByRepositoryId(repositoryId));
|
||||||
model.addAttribute("repository", repositoryRepository.findById(repositoryId).get());
|
model.addAttribute("repository", repositoryRepository.findById(repositoryId).get());
|
||||||
return "indexBranch";
|
return LIST_REPOSITORY_BRANCHES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
* You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
*/
|
||||||
|
|
||||||
package ru.ulstu.extractor.controller;
|
package ru.ulstu.extractor.controller;
|
||||||
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
@ -18,6 +23,8 @@ import java.util.Optional;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
|
import static ru.ulstu.extractor.controller.Route.FILTER_COMMITS;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class GitFilteringController {
|
public class GitFilteringController {
|
||||||
private final FilteringService filteringService;
|
private final FilteringService filteringService;
|
||||||
@ -40,7 +47,7 @@ public class GitFilteringController {
|
|||||||
return "resultRepo";
|
return "resultRepo";
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
@RequestMapping(value = "/filtering", method = RequestMethod.GET)
|
@RequestMapping(value = FILTER_COMMITS, method = RequestMethod.GET)
|
||||||
public String listCommits(
|
public String listCommits(
|
||||||
Model model,
|
Model model,
|
||||||
@ModelAttribute FilterForm filterForm,
|
@ModelAttribute FilterForm filterForm,
|
||||||
@ -64,6 +71,6 @@ public class GitFilteringController {
|
|||||||
filterForm.setBranch(branchName);
|
filterForm.setBranch(branchName);
|
||||||
filterForm.setUrl(repositoryUrl);
|
filterForm.setUrl(repositoryUrl);
|
||||||
model.addAttribute("filterForm", filterForm);
|
model.addAttribute("filterForm", filterForm);
|
||||||
return "filtering";
|
return FILTER_COMMITS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
* You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
*/
|
||||||
|
|
||||||
package ru.ulstu.extractor.controller;
|
package ru.ulstu.extractor.controller;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@ -15,6 +20,9 @@ import ru.ulstu.extractor.service.IndexService;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static ru.ulstu.extractor.controller.Route.FILTER_COMMITS;
|
||||||
|
import static ru.ulstu.extractor.controller.Route.INDEXING_NEW_REPOSITORY;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class GitIndexingController {
|
public class GitIndexingController {
|
||||||
private final GitRepositoryService gitRepositoryService;
|
private final GitRepositoryService gitRepositoryService;
|
||||||
@ -26,40 +34,39 @@ public class GitIndexingController {
|
|||||||
this.indexService = indexService;
|
this.indexService = indexService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/newRepo")
|
@GetMapping(INDEXING_NEW_REPOSITORY)
|
||||||
public String indexNewRepo(Model model) {
|
public String indexNewRepo(Model model) {
|
||||||
model.addAttribute(new RepoForm());
|
model.addAttribute(new RepoForm());
|
||||||
return "newRepo";
|
return INDEXING_NEW_REPOSITORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/newRepo", method = RequestMethod.POST, params = "send")
|
@RequestMapping(value = INDEXING_NEW_REPOSITORY, method = RequestMethod.POST, params = "send")
|
||||||
public String getBranch(@ModelAttribute RepoForm repoForm, Model model) {
|
public String getBranch(@ModelAttribute RepoForm repoForm, Model model) {
|
||||||
try {
|
try {
|
||||||
gitRepositoryService.cloneOrUpdateRepo(repoForm.getRepo());
|
gitRepositoryService.cloneOrUpdateRepo(repoForm.getRepo());
|
||||||
List<Branch> branches = gitRepositoryService.getBranches(repoForm.getRepo());
|
List<Branch> branches = gitRepositoryService.getBranches(repoForm.getRepo());
|
||||||
model.addAttribute("branches", branches);
|
model.addAttribute("branches", branches);
|
||||||
return "newRepo";
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
model.addAttribute("error", ex.getMessage());
|
model.addAttribute("error", ex.getMessage());
|
||||||
return "newRepo";
|
|
||||||
}
|
}
|
||||||
|
return INDEXING_NEW_REPOSITORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/newRepo", method = RequestMethod.POST, params = "next")
|
@RequestMapping(value = INDEXING_NEW_REPOSITORY, method = RequestMethod.POST, params = "next")
|
||||||
public String setBranch(@ModelAttribute RepoForm repoForm, Model model, RedirectAttributes redirectAttributes) {
|
public String setBranch(@ModelAttribute RepoForm repoForm, Model model, RedirectAttributes redirectAttributes) {
|
||||||
model.addAttribute("filterForm", new FilterForm(repoForm.getRepo()));
|
model.addAttribute("filterForm", new FilterForm(repoForm.getRepo()));
|
||||||
if (repoForm.getBranch() == null) {
|
if (repoForm.getBranch() == null) {
|
||||||
return "newRepo";
|
return INDEXING_NEW_REPOSITORY;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
indexService.index(repoForm.getRepo(), repoForm.getBranch());
|
indexService.index(repoForm.getRepo(), repoForm.getBranch());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
model.addAttribute("error", ex.getMessage());
|
model.addAttribute("error", ex.getMessage());
|
||||||
return "newRepo";
|
return INDEXING_NEW_REPOSITORY;
|
||||||
}
|
}
|
||||||
redirectAttributes.addAttribute("repositoryUrl", repoForm.getRepo());
|
redirectAttributes.addAttribute("repositoryUrl", repoForm.getRepo());
|
||||||
redirectAttributes.addAttribute("branchName", repoForm.getBranch());
|
redirectAttributes.addAttribute("branchName", repoForm.getBranch());
|
||||||
return "redirect:/filtering";
|
return "redirect:/" + FILTER_COMMITS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
* You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
*/
|
||||||
|
|
||||||
package ru.ulstu.extractor.controller;
|
package ru.ulstu.extractor.controller;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@ -5,17 +10,19 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import ru.ulstu.extractor.repository.RepositoryRepository;
|
import ru.ulstu.extractor.repository.RepositoryRepository;
|
||||||
|
|
||||||
|
import static ru.ulstu.extractor.controller.Route.LIST_INDEXED_REPOSITORIES;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class BaseIndexingController {
|
public class RepositoryController {
|
||||||
private final RepositoryRepository repositoryRepository;
|
private final RepositoryRepository repositoryRepository;
|
||||||
|
|
||||||
public BaseIndexingController(RepositoryRepository repositoryRepository) {
|
public RepositoryController(RepositoryRepository repositoryRepository) {
|
||||||
this.repositoryRepository = repositoryRepository;
|
this.repositoryRepository = repositoryRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/indexRepo")
|
@GetMapping(LIST_INDEXED_REPOSITORIES)
|
||||||
public String indexNewRepo(Model model) {
|
public String indexNewRepo(Model model) {
|
||||||
model.addAttribute("repositories", repositoryRepository.findAll());
|
model.addAttribute("repositories", repositoryRepository.findAll());
|
||||||
return "indexRepo";
|
return LIST_INDEXED_REPOSITORIES;
|
||||||
}
|
}
|
||||||
}
|
}
|
32
src/main/java/ru/ulstu/extractor/controller/Route.java
Normal file
32
src/main/java/ru/ulstu/extractor/controller/Route.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
* You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package ru.ulstu.extractor.controller;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class Route {
|
||||||
|
public static final String LIST_INDEXED_REPOSITORIES = "listRepositories";
|
||||||
|
public static final String LIST_REPOSITORY_BRANCHES = "listBranches";
|
||||||
|
public static final String INDEXING_NEW_REPOSITORY = "indexNewRepository";
|
||||||
|
public static final String FILTER_COMMITS = "filterCommits";
|
||||||
|
|
||||||
|
public static String getLIST_INDEXED_REPOSITORIES() {
|
||||||
|
return LIST_INDEXED_REPOSITORIES;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getLIST_REPOSITORY_BRANCHES() {
|
||||||
|
return LIST_REPOSITORY_BRANCHES;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getINDEXING_NEW_REPOSITORY() {
|
||||||
|
return INDEXING_NEW_REPOSITORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getFILTER_COMMITS() {
|
||||||
|
return FILTER_COMMITS;
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,8 @@
|
|||||||
|
<!--
|
||||||
|
~ Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
~ You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
-->
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="ru"
|
<html lang="ru"
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml">
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||||
@ -22,10 +27,12 @@
|
|||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
<ul class="navbar-nav mr-auto">
|
<ul class="navbar-nav mr-auto">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/" th:text="#{messages.menu.new-repo}">Link</a>
|
<a class="nav-link" th:href="${@route.INDEXING_NEW_REPOSITORY}"
|
||||||
|
th:text="#{messages.menu.new-repo}">Link</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/indexRepo" th:text="#{messages.menu.indexed-repos}">Link</a>
|
<a class="nav-link" th:href="${@route.LIST_INDEXED_REPOSITORIES}"
|
||||||
|
th:text="#{messages.menu.indexed-repos}">Link</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
|
<!--
|
||||||
|
~ Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
~ You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
-->
|
||||||
|
|
||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
||||||
<html xmlns:th="http://www.thymeleaf.org"
|
<html xmlns:th="http://www.thymeleaf.org"
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
layout:decorate="~{default}">
|
layout:decorate="~{default}">
|
||||||
<head>
|
<head>
|
||||||
<title>Простая обработка формы на Spring MVC</title>
|
<title>Фильтрация коммитов репозитория</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
</head>
|
</head>
|
||||||
<div class="container" layout:fragment="content">
|
<div class="container" layout:fragment="content">
|
||||||
<form action="#" th:action="@{/sendFilter}" th:object="${filterForm}" method="post">
|
<form action="#" th:action="${@route.FILTER_COMMITS}" th:object="${filterForm}" method="post">
|
||||||
<p><b>Фильтровать данные:</b><Br></p>
|
<p><b>Фильтровать данные:</b><Br></p>
|
||||||
По автору
|
По автору
|
||||||
<select class="selectpicker" data-live-search="true">
|
<select class="selectpicker" data-live-search="true">
|
@ -1,32 +0,0 @@
|
|||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
|
||||||
<html xmlns:th="http://www.thymeleaf.org"
|
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
|
||||||
layout:decorate="~{default}">
|
|
||||||
<head>
|
|
||||||
<title>Простая обработка формы на Spring MVC</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
||||||
</head>
|
|
||||||
<div class="container" layout:fragment="content">
|
|
||||||
<h1>Форма</h1>
|
|
||||||
<form action="#" th:action="@{/sendEmail}" th:object="${emailForm}" method="post">
|
|
||||||
<p style="color:red" th:text="${error}"></p>
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Тема:</td>
|
|
||||||
<td><input type="text" th:field="*{subject}"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Кому:</td>
|
|
||||||
<td><input type="text" th:field="*{to}"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Сообщение:</td>
|
|
||||||
<td><textarea th:field="*{message}"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2"><input type="submit" value="Отправить"/></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</html>
|
|
@ -1,3 +1,8 @@
|
|||||||
|
<!--
|
||||||
|
~ Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
~ You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
-->
|
||||||
|
|
||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
||||||
<html xmlns:th="http://www.thymeleaf.org"
|
<html xmlns:th="http://www.thymeleaf.org"
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
@ -7,7 +12,7 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
</head>
|
</head>
|
||||||
<div class="container" layout:fragment="content">
|
<div class="container" layout:fragment="content">
|
||||||
<form action="#" th:action="@{/newRepo}" th:object="${repoForm}" method="post">
|
<form action="#" th:action="${@route.INDEXING_NEW_REPOSITORY}" th:object="${repoForm}" method="post">
|
||||||
<p style="color:red" th:text="${error}"></p>
|
<p style="color:red" th:text="${error}"></p>
|
||||||
<button class="btn btn-outline-dark dropdown-toggle" type="button" data-toggle="collapse"
|
<button class="btn btn-outline-dark dropdown-toggle" type="button" data-toggle="collapse"
|
||||||
data-target="#collapseOne" aria-expanded="false" aria-controls="collapseExample"
|
data-target="#collapseOne" aria-expanded="false" aria-controls="collapseExample"
|
@ -1,3 +1,8 @@
|
|||||||
|
<!--
|
||||||
|
~ Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
~ You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
-->
|
||||||
|
|
||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
||||||
<html xmlns:th="http://www.thymeleaf.org"
|
<html xmlns:th="http://www.thymeleaf.org"
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
@ -15,7 +20,8 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:each="branch: ${branches}">
|
<tr th:each="branch: ${branches}">
|
||||||
<td><a th:href="@{'/filtering?branchName='+${branch.name}+'&repositoryUrl='+${repository.url}}"
|
<td>
|
||||||
|
<a th:href="@{${@route.FILTER_COMMITS} + '?branchName='+${branch.name}+'&repositoryUrl='+${repository.url}}"
|
||||||
th:text="${branch.name}"/></td>
|
th:text="${branch.name}"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
@ -1,3 +1,8 @@
|
|||||||
|
<!--
|
||||||
|
~ Copyright (C) 2021 Anton Romanov - All Rights Reserved
|
||||||
|
~ You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
|
-->
|
||||||
|
|
||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
||||||
<html xmlns:th="http://www.thymeleaf.org"
|
<html xmlns:th="http://www.thymeleaf.org"
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
@ -15,7 +20,8 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr th:each="repo: ${repositories}">
|
<tr th:each="repo: ${repositories}">
|
||||||
<td><a th:href="@{'/details?repositoryId='+${repo.id}}" th:text="${repo.url}"></td>
|
<td><a th:href="@{${@route.LIST_REPOSITORY_BRANCHES} + '?repositoryId=' + ${repo.id}}"
|
||||||
|
th:text="${repo.url}"></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
@ -1,18 +0,0 @@
|
|||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
|
||||||
<html
|
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
|
||||||
layout:decorate="~{default}">
|
|
||||||
<head>
|
|
||||||
<title>Простая обработка формы на Spring MVC</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
||||||
</head>
|
|
||||||
<div class="container" layout:fragment="content">
|
|
||||||
<body>
|
|
||||||
<form oninput="result">
|
|
||||||
<p>Данные репозитория:</p>
|
|
||||||
<p>
|
|
||||||
<output name="result"></output>
|
|
||||||
</form>
|
|
||||||
</body>
|
|
||||||
</div>
|
|
||||||
</html>
|
|
Loading…
Reference in New Issue
Block a user