I have java web application which uses velocity UI. There is hyperlink which calls the service hosted by same application.
#set($myhost=$ServerContext.getFullHostName()) //Trying to set the host name to the machine name on which application is currently deployed. Below url link calls the service
<a href="http://$myhost:8080/cfgedit/prstatuscheck?host=$host.name&app=$pool.label" target="_blank">
$StringUtils.substringBefore($host.name, ".")</a></li>

I m seeing issues while trying to retrieve host name for the url. No problem with other parameters. InetAddress.getLocalHost().getHostName() also didnt work.

Please suggest the way to use java system library classes inside velocity UI

Thanks
Archana