users@woodstock.java.net

Re: Session Expiration in IE6 and IE7 ...

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Fri, 11 Apr 2008 10:44:57 -0400

tonyweb wrote:
> Hi to all,
> this is my first post and I thank in advance those who will read this post
> and will help me.
>
> I'm using Woodstock release bundled with NetBeans 6 (latest available
> download) ( I think version 4.1 )
> and I suffer of two/three big problems ... and I hope yuo will give me hints
> to solve them.
>
> First problem: Session expiration
> ----------------------------------------
> After about twenty postbacks the session expires ( and variables declared
> inside SessionBean1 expire as well - they are all set to null ) and my
> filter which checks for login redirects me to the Login page.
>
> I followed the advice to block all cookies (setting privacy level to
> maximum) but this does not solve the problem ... indeed in IE7 these
> settings make a java.util.ArrayList in SessionBean1 being null at first page
> change: I use that arrayList for populating a Tree component which does not
> render ( error 500 ).
>

I don't believe this is a Woodstock issue. JSF based web apps typically
set the session timeout via a config property in the web.xml file. For
example:

<session-config>
  <session-timeout>15</session-timeout>
</session-config>

>
> Second problem: Rendering speed
> ------------------------------------------
> I know there are many post regarding this topic. I would like to know if
> there's a way to avoid client-side rendering ( with javascript ) with my
> version of controls ... I read there's such a way in newer release (
> parseOnLoad, enableJSfxAll, ecc... )
>

Sorry, but this is not configurable. The older Woodstock 4.0 release
used server-side JSF renderers to output HTML, but we've been slowly
moving away from this approach -- too dependent on a single framework.
There are still a few HTML renderers in the mix, but the majority are
client-side rendered to better support Ajax features. Eventually, this
will help us support other frameworks like PHP and JRuby. In fact, bench
testing shows that the latest Woodstock releases perform as good or
better than the old HTML renderers used in Woodstock 4.0.

That said, you should consider upgrading from 4.1 to 4.1.1 because there
are significant performance improvements. Similarly, the 4.2 release has
even more performance improvements than the previous releases. The GA
release will be announced when Netbeans 6.1 is made available, but you
can use it now via the Netbeans 6.1 release candidate.

If you want to tweak performance, look at the tag attributes for the
head tag. Depending on what widgets are used in the page, webuiAll,
webuiJsfx, etc. could make a significant difference in the amount of
requests generated for the page.

>
> Third problem: Positioning Focus with javascript
> -------------------------------------------
> In my constrols' version I use "webui.body.updateFocusElement()" (or
> something similar ;) ) function for "moving" focus ... but in new versions,
> that function does not exists anymore. I did not find its substitute ... any
> hint ?
>

You should not be using this function directly -- this is a private API.
This is used by the JSF components to restore focus after a page has
been submitted. It requires a knowledge of the underlying HTML elements
used by the widgets. Pleas note that all the public JavaScript APIs are
documented in the TLD docs below.

    http://webdev2.sun.com/woodstock-tlddocs

Using the textField as an example, there is a getInputElement() function
you can use to gain access to the underlying HTML input element. To set
focus, you can use JavaScript similar to this:

    var widget = document.getElementById("form:textField");
    widget.getInputElement().focus();

That said, it might be more intuitive if we add a focus() function to
each widget? If you think this might be useful, please file an RFE.

Thanks,
Dan