On 07.03.2008, at 13:01, lars vonk wrote:
I guess you can't. Since you are in the Application init method I don't think there is a requestcycle available (request cycles represents the processing of a request).
I am not trying to get the request cycle inside my application's init(), but in getResourceStream(). Still, I think your explanation applies again: getResourceStream() is apparently called (why?) even when the web server is doing a HEAD request, in which case there is (?) no request cycle either. Could this be the case?
On Fri, Mar 7, 2008 at 12:19 PM, Kaspar Fischer <[EMAIL PROTECTED]> wrote:How can I get hold of the current request cycle in a subclass of WebResource? In public final class RepositoryFileResource extends WebResource { /* ... */ public IResourceStream getResourceStream() { RequestCycle cycle = RequestCycle.get(); cycle is null. P.S. I am registering my resource in my application's init() getSharedResources().add("repo", new RepositoryFileResource()); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
