I am writing a Java web application using Spring MVC. I have a background process that goes through a database and finds notifications that should be emailed to my users. These email messages must include hyperlinks in the app. This seems like a pretty common web application pattern, but I'm having problems.
How to get the full URL of my application with server name and context? I do not have access to any of the methods in the HttpServletRequest, because I run it as a background process, and not in response to a web request. The best I can do is access the ServletContext.
Currently, I put the base URL in the configuration file and read it at startup, but this application will be licensed and deployed on the client application servers, and if possible, I would like them to not have to configure it manually.
java java-ee spring-mvc
Josh Hinman Mar 24 '09 at 0:29 2009-03-24 00:29
source share