Hello,

I would like to be able to dynamically retrieve the "servlet context path" (e.g. http://localhost/myapp or http://www.mysite.com) for my spring web application from a Service spring bean.

Ideally I would retrieve the context path upon startup of the application and having it available for retrieval at all times by all my services.

The reason for this is that I want to use this value in email that are going to be sent to users of the website.

Can anyone please advise?

Regards,

Julien.