title: I want to add my current url to to a meta tag for the attribute content
body: <p>I want to add my current url inside a meta tag for content value, currently its incorrect using some objects that are pointing at the wrong url. </p>
  
  <pre><code>&lt;meta property="og:url" content="${request.requestURL.toString}" /&gt;
  
  </code></pre>
  
  <p>This returns the wrong url, this tag is inside a  component that is used in many other pages through out the site, so its recycled and i cant just hardcode the url. </p>
  
  <p>This is what i tried to do with some javascript but it is not working and i believe it runs the script before it knows what url it is in . </p>
  
  <pre><code>&lt;script&gt;
  
      var currentLocation = window.location;
      &lt;/script&gt;
  &lt;meta property="og:url" content="${currentLocation}" /&gt;
  
  
  
  
  </code></pre>
  
  <p>but it does not return the current location 
  it just shows this when i do view page source
  it does not even show the content attribute  </p>
  
  <pre><code>&lt;meta property="og:url"/&gt;
  
  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/2XH8q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2XH8q.png" alt="enter image description here"></a></p>
  
  <p>If i inspected i can see the url being reference in the variable</p>