Take a look into those two questions previously asked: Get the server port number from tomcat with out a request and I need to know the HTTP and HTTPS port my java webapp is running on webapp startup. There you will see how to get port from a Connector, connector also has getDomain method that would give you host name.
Since you know how to get without spring, you can have a bean that gets those details and provides them for the other bean that needs those instantiation detail. There are few ways to do that:
1) Create Spring factory bean that would get port, hostname and instantiates bean you want
2) Have separate bean that holds those details for you and you use that bean to construct other one
3) You override your application details with port and domain and when instantiating bean that needs them have a init method that would read them for your new bean