You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by David Chang <da...@yahoo.com> on 2010/02/21 20:37:43 UTC

Questions about how wicket serialization works

I am reading the book Wicket in Action. Page 88 about serializing models says: 

"At the end of the request, after the markup has been sent to the browser, Wicket stores the page, component hierarchy, and associated models (the state) in the page store."

Does "Wicket stores the page" means Wicket stores all the page content (markup plus Wicket-inserted content) sent to the the browser? 

I did an experiement in which there are two clock pages with dynamtic models (same java class and markup, but differnet class/file names). Clicking on a link goes to the second clock page. When I click IE Back button to go back to the first clock page, it always shows the current date/time. How so? Why not showing the previous date/time when the first clock page was loaded?

My understanding is that when a page is refreshed, each Wicket componet on a page calls its getObject to update content. Does the Back button get the getObject method called too?

What did I miss?

Thanks, David


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Questions about how wicket serialization works

Posted by Eelco Hillenius <ee...@gmail.com>.
> Wicket stores
> 1. the page,
> 2. component hierarchy,
> 3. and associated models (the state) in the page store."
>
> By "only the serialized form of the page hierarchy is stored.", you mean the first two things?

The page == component hierarchy and associated models are part of it
because they are referenced by the components.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Questions about how wicket serialization works

Posted by David Chang <da...@yahoo.com>.
Erik,

Thanks so much for reply to my questions.

>>No, only the serialized form of the page hierarchy is stored.

What do you exactly mean? WiA mentions three things:

Wicket stores 
1. the page, 
2. component hierarchy, 
3. and associated models (the state) in the page store."

By "only the serialized form of the page hierarchy is stored.", you mean the first two things?

Regards,
David


--- On Sun, 2/21/10, Erik van Oosten <e....@grons.nl> wrote:

> From: Erik van Oosten <e....@grons.nl>
> Subject: Re: Questions about how wicket serialization works
> To: users@wicket.apache.org
> Date: Sunday, February 21, 2010, 3:30 PM
> Answers below...
> 
> David Chang wrote:
> > I am reading the book Wicket in Action. Page 88 about
> serializing models says: 
> > "At the end of the request, after the markup has been
> sent to the browser, Wicket stores the page, component
> hierarchy, and associated models (the state) in the page
> store."
> > 
> > Does "Wicket stores the page" means Wicket stores all
> the page content (markup plus Wicket-inserted content) sent
> to the the browser?   
> No, only the serialized form of the page hierarchy is
> stored. From this all other content can be reloaded (note:
> markup is only read once and cached when in production
> mode).
> 
> > I did an experiement in which there are two clock
> pages with dynamtic models (same java class and markup, but
> differnet class/file names). Clicking on a link goes to the
> second clock page. When I click IE Back button to go back to
> the first clock page, it always shows the current date/time.
> How so? Why not showing the previous date/time when the
> first clock page was loaded?
> >   
> When you press the back button, you'll see whatever the
> browser has cached.
> > My understanding is that when a page is refreshed,
> each Wicket componet on a page calls its getObject to update
> content. Does the Back button get the getObject method
> called too?
> >   
> After using the back button, reload the page, and you'll
> get the re-rendered content.
> > What did I miss?
> > 
> > Thanks, David
> >   
> 
> Regards,
>     Erik.
> 
> -- Send from my SMTP compliant software
> Erik van Oosten
> http://day-to-day-stuff.blogspot.com/
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Questions about how wicket serialization works

Posted by Erik van Oosten <e....@grons.nl>.
Answers below...

David Chang wrote:
> I am reading the book Wicket in Action. Page 88 about serializing models says: 
>
> "At the end of the request, after the markup has been sent to the browser, Wicket stores the page, component hierarchy, and associated models (the state) in the page store."
>
> Does "Wicket stores the page" means Wicket stores all the page content (markup plus Wicket-inserted content) sent to the the browser? 
>   
No, only the serialized form of the page hierarchy is stored. From this 
all other content can be reloaded (note: markup is only read once and 
cached when in production mode).

> I did an experiement in which there are two clock pages with dynamtic models (same java class and markup, but differnet class/file names). Clicking on a link goes to the second clock page. When I click IE Back button to go back to the first clock page, it always shows the current date/time. How so? Why not showing the previous date/time when the first clock page was loaded?
>   
When you press the back button, you'll see whatever the browser has cached.
> My understanding is that when a page is refreshed, each Wicket componet on a page calls its getObject to update content. Does the Back button get the getObject method called too?
>   
After using the back button, reload the page, and you'll get the 
re-rendered content.
> What did I miss?
>
> Thanks, David
>   

Regards,
     Erik.

-- 
Send from my SMTP compliant software
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Questions about how wicket serialization works

Posted by Erik van Oosten <e....@grons.nl>.
This has been discussed before (of course) and this is on purpose. If 
you reload old pages your users will probably wonder what's going on 
(they are not used to this behavior), and secondly there is a 
performance hit with no business benefit.

However, you should feel free to change these defaults (by overriding 
setHeaders) for cases where another setting is more appropriate.

Regards,
    Erik.


kellerautomat wrote:
> btw, gere is an interesting point, where IE and Firefox differ from each
> other. If you click the back-button of Firefox the page does not reload but
> is loaded from cache.
>
> http://blog.httpwatch.com/2008/10/15/two-important-differences-between-firefox-and-ie-caching/
>
> maybe cache-control should be changed to: "Cache-Control: no-cache,
> no-store, max-age=0, must-revalidate"
> in org.apache.wicket.markup.html.WebPage.setHeaders(WebResponse)
>
> should i open a JIRA?
>   

-- 
Send from my SMTP compliant software
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Questions about how wicket serialization works

Posted by kellerautomat <fj...@gmail.com>.
btw, gere is an interesting point, where IE and Firefox differ from each
other. If you click the back-button of Firefox the page does not reload but
is loaded from cache.

http://blog.httpwatch.com/2008/10/15/two-important-differences-between-firefox-and-ie-caching/

maybe cache-control should be changed to: "Cache-Control: no-cache,
no-store, max-age=0, must-revalidate"
in org.apache.wicket.markup.html.WebPage.setHeaders(WebResponse)

should i open a JIRA?


davidqz wrote:
> 
> 
> My understanding is that when a page is refreshed, each Wicket componet on
> a page calls its getObject to update content. Does the Back button get the
> getObject method called too?
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/301-redirect-tp27642826p27684063.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org