java - Is possible to get web application full url from Spring service that is invoked by task? -


i have service not invoked user request, task. need send email task, , email contains link web application, how can full url of application email can link web application?

example of service:

@service public class myservice {      @scheduled(cron="0 */10 * * * *")     @transactional     public void mytask() throws ioexception, parseexception     {         // have send email app url, how can here ?     }  } 

you cannot it, since web application doesn't know own domain name. can extract domain name used send request request.

therefore domain name of application should part of configuration, , task should obtain there.


Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

Java - Returning an array from a method to main -