<c:url var="myUrl" value="/MyPath/${MyID}"/>
which I then use later (to enable users to copy links) :
<input size="35" disabled value="${myUrl}" />
and it shows
/my-app-name/MyPath/23
however I want it to be
http://myHost/my-app-name/MyPath/23
I can prepend the string sure, but wanted a way to actively get the correct hostname ... ?
You need to prepare it yourself based on
HttpServletRequest#getRequestURL()
and a little help of JSTL functions:HttpServletRequest object has all the details:
getProtocol
getServerName
getContextPath
so I think you can use:
to build what you want.