title: How to build a dynamic URL in Spring MVC?
body: <p>I am trying to send one URL which I will generate on basis of some dynamic value. But I don't want to hard code it nor want to use response or request object.</p>
  
  <p>Example:  </p>
  
  <blockquote>
    <p><em><a href="http://localhost:8585/app/image/" rel="noreferrer">http://localhost:8585/app/image/</a>{id}/{publicUrl}/{filename}</em></p>
  </blockquote>
  
  <p>So I want to get the first part (i.e. <a href="http://localhost:8585/app/image" rel="noreferrer">http://localhost:8585/app/image</a>)
  from Spring Framework only. I will provide rest of the things like <code>id</code>, <code>publicUrl</code>, <code>filename</code>, so that it can generate a complete <em>absolute</em> URL.</p>
  
  <p>How to do it in Spring MVC?</p>