myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randahl Fink Isaksen <>
Subject Re: NUMBER_OF_VIEWS_IN_SESSION - how long is a view valid
Date Mon, 06 Nov 2006 14:42:05 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Thanks David - that was very informative.<br>
I can't help but thinking that quite many applications would want to
lower the NUMBER_OF_VIEWS_IN_SESSION from the default 20. I mean if the
user really visits the same website 20 times and thus sees view 1, 2,
..., 20, what are the chances that he will go back and visit, say, view
4? On many sites I would assume that the chance of that is quite low,
which could indicate that a much lower number would be relevant. <br>
Suppose you lower the NUMBER_OF_VIEWS_IN_SESSION to, say, 5, there will
obviously be a greater chance that the user will revisit a view that is
no longer cached, but since the server is supposed to be able to
deliver that view pretty fast on his first visit anyway it will of
course also be able to deliver the view quite fast on his second visit
even though the view is not cached. <br>
So why is 20 the default?<br>
David Delbecq wrote:
<blockquote cite="" type="cite">
  <pre wrap="">Hi randahl,

I recommend you take a look at the JSF lifecycle and more particulary at
the 'Restore view' and the 'Render response' part.
<a class="moz-txt-link-freetext" href=""></a>

The view is a set of components. The components are read (initial view)
with their static values and their EL values and then rendered multiple
time. It's at render time that the 'day/night' should be evaluated. If
you have this in you page:
calor="#{dayBean.isNight?'#000000':'#FFFFFF'}/&gt; then you are sure that
background color will always be correct as long as dayBean.isNight() is
Randahl Fink Isaksen a &eacute;crit :
  <blockquote type="cite">
    <pre wrap="">I read that the default for NUMBER_OF_VIEWS_IN_SESSION is 20, meaning
that MyFaces will store the latest 20 of a client's views in the
client's session. This made me wonder how MyFaces tells the difference
between the views and how MyFaces know when to reuse a view. For
instance if you visit "/aView.jsf" in a browser how can MyFaces tell
whether that view can be safely stored and reused later in the session
if you visit the same view again?

Let me give an example: Let us say that the view on the address
"/aView.jsf" uses a component which makes the background color of the
page white during daytime and black during the night. If I then visit
the view just before nightfall and receive a white page and then
revisit the view during the same session but right after nightfall,
what color will the view then be? I would think that if the original
view is reused it would still be white even though it should actually
now have changed to black. So how can I as a developer tell MyFaces
whether or not it is safe to store the information about the
background color and for how long the information is valid?

Has anyone found some documentation about this?

Thank you


  <pre wrap=""><!---->


View raw message