You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ken Pelletier <ke...@nika.com> on 2004/06/10 18:50:56 UTC

Dynamically creating URLs w/o request?

I have a struts application that makes use of an email service layer.  
The email service provides a merge facility (via Velocity) and a 
delivery facility (via JavaMail).

Typically, the application invokes the mail service within a struts 
action, where it has access to the request to get the relevant URL into 
a merge context.  Here I make use of RequestUtils.serverURL(request), 
request.getContextPath(), et al. to cook up a URL string.

I now have a new use case where a service thread running inside the 
container will be invoking the email service.  Since this thread does 
not have access to a request, I'm struggling to find a way to get 
dynamically create URLs for a merge context without declaring anything 
statically inside a config.

Any suggestions?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org