У меня есть динамический внешний URL, который я устанавливаю в модели на стороне контроллера и пытаюсь получить доступ к html с помощью тега thymleaf
Вот код:
Контроллер:
@RequestMapping(value = "/{id:.+}", method = RequestMethod.GET)
public String searchUser(@PathVariable("id") String data, Model model) {
/*
* if (!data.startsWith("@")) { data = "@" + data; }
*/
List<User> list = userService.searchUserUsingText(data);
if (list.isEmpty()) {
System.out.println("error");
return "404";
} else {
User user = list.get(0);
if (null != user.getName())
model.addAttribute("name", user.getName());
if (null != user.getProfession())
model.addAttribute("profession", user.getProfession());
if (null != user.getPhotoUrl()) {
System.out.println("inside image" + user.getPhotoUrl());
model.addAttribute("image" + user.getPhotoUrl());
}
return "profile";
}
}
PhotoUrl будет внешним URL-адресом, таким как: https://firebasestorage.googleapis.com/v0/b/mysocialhandle-ecfc0.appspot.com/o/images%2FFtX4VVciacM1jKdrP2NfInSyWMf1%2FFtX4VVciacM1jKdrP2NfInSyWMf1.jpg?alt=media&token=10e06c9b-044e-4e15-ab74-a55429bcb22b
Сторона Thymleaf / Html:
<div class="container">
<div class="owner">
<div class="avatar">
<img th:src="@{${image}}" alt="Circle Image"
class="img-circle img-no-padding img-responsive">
</div>
<div class="name">
<h4 class="title" th:text="${name}">
<br />
</h4>
<h6 class="description" th:text="${profession}"></h6>
</div>
</div>
Имя и профессия решаются идеально, но приimg Tag я получаю нулевое значение.
Ребята, пожалуйста, помогите в этом ...