I had this same problem with tapestry-cometd where I needed to render
components asynchronously outside of a normal request / response. I solved
this problem with the ComponentJSONRenderer which spoofs a request and
response in order to run the tapestry template rendering. Code here:

https://github.com/uklance/tapestry-cometd/blob/master/src/main/java/org/lazan/t5/cometd/services/internal/ComponentJSONRendererImpl.java

I started to extract the logic into a reusable tapestry-offline module but
never finished the job

https://github.com/uklance/tapestry-offline

The idea was to split the spoof request into OfflineRequestContext and an
OfflineRequestGlobals and OfflineRequestGlobals could be IOC overridden to
provide server, port etc.

I hope to one day have tapestry-cometd depend on tapestry-offline.

Pull requests welcome!
 On 1 Aug 2013 09:36, "Jan Fryblik" <jan.fryb...@gmail.com> wrote:

> **
> Hi guys,
>
> i've run into terrible issue with jobs. I need to generate link which is
> afterwards sent to user, but issue is... Job is not executed with http
> request so that i haven't informations about request to generate the link,
> so it throws NullPointerException.
>
> Is there any other option then having the link permanently stored e.g. in
> database? Probably there is also option to create in job a "fake" request
> which generates complete email including the link. I don't like even this
> solutions, anything else? :( Thanks a lot.
>
> Best Regards,
> Jan
>
>

Reply via email to