patch no image data
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
package fr.eni.enchere.bll;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
@Service
|
||||
public class FileService {
|
||||
|
||||
public boolean fileExists(String filePath) {
|
||||
return Files.exists(Paths.get(filePath));
|
||||
return Files.exists(Paths.get("src/main/resources/static"+filePath));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// src/main/resources/static/images/articles/12.jpg
|
||||
@@ -69,8 +69,9 @@ public class AccueilController {
|
||||
|
||||
// Pagination
|
||||
Page<Article> articlePage = articleService.searchArticlePageable(critere, PageRequest.of(page, size));
|
||||
model.addAttribute("articles", articlePage.getContent());
|
||||
|
||||
model.addAttribute("articles", articlePage.getContent());
|
||||
model.addAttribute("fileService", fileService);
|
||||
int currentPage = page + 1;
|
||||
model.addAttribute("currentPage", currentPage);
|
||||
model.addAttribute("critere", critere);
|
||||
|
||||
Reference in New Issue
Block a user