For a bean which emails users confirmation links, I'd like to generate the URL dynamically, which means that I should know:
- the protocol;
- the server (virtual host) name;
- the server port
- the context path.
on which the application is running.
I will not be running a Controller at that time, so I'd like to retrieve this data somehow.
I've found ServletContextAware
so I'm using that for the context path, but have no idea for the rest. Where can I find them?