Reputation: 313
Im trying to render a webapge and use the thymleaf attribute "url" added with model.addAttribute but the Attribute is not beeing displayed on the html document.
My document.html file path is here:
/templates/webpage/document.html
@RequestMapping(value = "/webpage/document")
public String document(HttpServletRequest req, Model model) {
model.addAttribute("dialogurl", url);
return "/webpage/document";
}
Here is the html document
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:include="wrapperdialog :: page">
<head>
<title></title>
</head>
<body>
<div th:fragment="content">
<div class="container dialogpage">
<div class="row">
<div class="col-md-12">
<div id="typeform" th:attr="data-url=*{dialogurl}">
</div>
</div>
</div>
</div>
</div>
Upvotes: 1
Views: 1316
Reputation: 4074
Please use this expression to bind dialog url: @{${dialogurl}}
<div id="typeform" th:attr="data-url=@{${dialogurl}}">
@
prefix is used to specify a link and $
prefix is used to bind your model value.
Upvotes: 1
Reputation: 2447
Use $
to bind data.
<div id="typeform" th:attr="data-url=${dialogurl}">
Upvotes: 0