We can get an application URL with the code:
RWT.getRequest().getRequestURL();
Do we have any way to configure this URL (host, port) in VM arguments or properties or any other ways (not in Java code)?
Both hostname and port aren't part of a RAP application's configuration.
The hostname is determined by the network configuration of the machine running the application and other factors like proxy servers in between client and server.
The servlet container (Tomcat, Jetty, and the like) that a RAP application runs on controls which port it uses. Hence the servlet container's configuration needs to be changed in order to change the port.