Updated code for picking rest URL based on tomcat parameter