Hi,

You can export the Application as thread local manually.
See for example:
https://github.com/apache/wicket/blob/442932d4e4c5cc27940bc2ef956cb24c1ba54df0/wicket-experimental/wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/AbstractWebSocketProcessor.java#L200
Make sure you reset it to null at the end.

Martin Grigorov
Wicket Training & Consulting


On Fri, Dec 13, 2013 at 6:39 PM, dgn <[email protected]> wrote:

> Hello-
>
> I'm attempting to use the Wicket 6 email templating mechanism to render an
> HTML email from a Panel OUTSIDE the normal request/response cycle -- in a
> timer thread. I have already been successful generating email from within a
> normal request by following the examples at
> http://www.wicket-library.com/wicket-examples/mailtemplate/
>
> The timer thread periodically checks the database for a particular
> situation
> and, if the requirements are met, an email is generated.
>
> I have searched in vain in this forum for a solution. Two main problems I
> am
> running into are:
> - Getting the error message "There is no application attached to current
> thread"
> - Using @SpringBean does not work outside the Wicket context. This is true
> even if I start the time thread within Application.init()
>
> I'd prefer to generate the email from a Panel as I already have those in
> place but would definitely be willing to do so from a page.
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Generating-email-from-template-outside-request-response-cycle-tp4663011.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to