the hack i can come up with when looking at the code is this:

override this method


call super
keep a reference to the MarkupResourceStream

and in detach call MarkupCache.removeMarkup with that reference.
But tis is really a hack because it should be removed from the cache much
earlier (it should never go in)
because if you have 2 the same request of different clients....

But i think you should also really look why do you need it.
Markup that already has state of the session thats a bit weird. Cant you do
how it goes with everything
stateless markup but then the session inserts the info?

johan


On Nov 14, 2007 2:02 PM, Andrew MacKenzie <[EMAIL PROTECTED]> wrote:

> Unfortunately it seems that in 1.2 getAssociatedMarkupStream is *final*.
>
> And 'getMarkupStream()' only takes (MarkupContainer container, boolean
> throwException).  I pressume the second parameter you listed was for cache
> control?
>
> MarkupCache does allow for me to clear the cache and such though.  I can
> try doing that as soon as my page is rendered, but I'll still have the
> narrow chance that two pages are rendering at the same time (multiplied by
> lots of users over a long period this becomes quite likely).
>
> I'm going to guess I'm out of luck in 1.2 then?
>
> +++ Johan Compagner [wicket-users] [Wed, Nov 14, 2007 at 08:55:51AM
> +0100]:
>  > in 1.3 you can override some methods of your page that shouldn't me
> cached.
> > don't know from top of my head what the 1.2 methods are but in 1.3:
> > *
> >
> > public* MarkupStream getAssociatedMarkupStream(*final*
> *boolean*throwException)
> > (of the MarkupContainer)
> > and then make the call:
> >
> > *
> >
> >
> return*getApplication().getMarkupSettings().getMarkupCache().getMarkupStream(
> > *this*,*true*, throwException);
> > that true should take care that it always is reloaded.
> >
> > On Nov 13, 2007 11:55 PM, Andrew MacKenzie <[EMAIL PROTECTED]> wrote:
> >
> > > +++ Johan Compagner [wicket-users] [Tue, Nov 13, 2007 at 11:40:07PM
> > > +0100]:
> > > > ahh wait your are not talking about Resource (the class and then the
> > > > SharedResources) But you are talking about what the
> > > IResourceSteamLocator
> > > > does return for Markup and other kind of (classpath) Resources?
> > > Yes, sorry for the confusion - I didn't realize there were so many
> things
> > > called "Resource."
> > >
> > > > Yes those are cached in 1.2 we didn't cache properties files yet,
> But
> > > the
> > > > Localizer does now.
> > > > but in 1.2 we already did have the MarkupCache. And that one polls
> your
> > > > streams for the last modified time
> > > > and if that is different it will clear the cache.
> > > >
> > > > but what do you cache (or don't you want to cache)? is it markup?
> > > Yes - I don't want the markup cached.  I'd like for Wicket to always
> try
> > > to
> > > fetch it new on every new request.
> > >
> > > I've found that I can tell wicket to poll very frequently via
> > > ".setResourcePollFrequency", but this will only 'mitigate' my issue,
> not
> > > solve it.
> > >
> > >
> > > --
> > > // Andrew MacKenzie  |  http://www.edespot.com
> > > // GPG public key: http://www.edespot.com/~amackenz/public.key
> > >  // "If my theory of relativity is proven successful, Germany will
> claim
> > > //  me as a German and France will declare that I am a citizen of the
> > > //  world. Should my theory prove untrue, France will say that I am a
> > > //  German and Germany will declare that I am a Jew."
> > > //     -- Albert Einstein
> > >
>
> --
> // Andrew MacKenzie  |  http://www.edespot.com
> // GPG public key: http://www.edespot.com/~amackenz/public.key
> // Perilous to all of us are the devices of an art deeper than we
> ourselves
> // possess.
> //                 -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the
> Rings"]
>

Reply via email to