Need to add canonical tag in jsp
<link rel="canonical" url="http://www.example.com"/>
But i dont want to hard code the url value.
How can i achieve this.
I have tried using data binding techniques but in view source, link tag is shown as
<link rel="canonical" href="" data-bind="attr:{href: ko.toJS($root.seoURLCanonical)}"/>
instead of
<link rel="canonical" url="http://www.example.com"/>
while inspecting we can see canonical link tag as
<link rel="canonical" href="http://www.example.com" data-bind="attr:{href: ko.toJS($root.seoURLCanonical)}"/>