myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <andreas.mit...@magnasteyr.com>
Subject AW: Execute method automatically after page has been loaded and shown to user
Date Wed, 07 Dec 2005 09:29:02 GMT
Hi Mike!

I like the idea with the Servlet Listener,but I see one problem:
The database connection is already openened when the Application Server is started
-So could there be a problem with database connection timeouts? What happens, when the database
returns a timeout.
-If no timeout happens, isn't it a bad approach to let the connection open all the time, because
database connection are expensive as long as I know?

What do you think about my thoughts?

Regards
Andy

-----Urspr√ľngliche Nachricht-----
Von: Mike Kienenberger [mailto:mkienenb@gmail.com]
Gesendet: Dienstag, 6. Dezember 2005 17:22
An: MyFaces Discussion
Betreff: Re: Execute method automatically after page has been loaded and
shown to user


Andy,

There's many ways to do this.

Some ways you could do it:

1) Use the Shale ViewController stuff to define your backing bean to
be the controlling bean for your page.  It'd be able to receive events
like pre-render and post-render.

2) Create a phase listener that ran at pre-render and post-render phase.

3) Use a servlet filter -- this is how I manage my database
connections, but I have need for my database connection to be active
at all phases of JSF.

On 12/6/05, andreas.mitter@magnasteyr.com <andreas.mitter@magnasteyr.com> wrote:
>
>
> Hi All!
>
> How can I execute a method from a backing bean AUTOMATICALLY after a page
> has been loaded and shown to the user?
>
> My exactly problem is the following:
> When the user opens the first page, this page should be shown normally (and
> quickly) to the user. In the background the connection to the database
> should be build (automatically, no button should be pressed) -->I use
> Hibernate and the first connection (building of connection pool) takes some
> seconds, so this should be done in background, but the user should already
> see something in his browser (with an info, that the connection to the
> database is just built)
>
> Is there a possibility to do that?
>
> Thx
>
> Regards
> Andy
> ______________________________________________________________________
> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify your system manager.
> This footnote also confirms that this email message has been swept for the
> presence of computer viruses.
> ______________________________________________________________________
>


______________________________________________________________________

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
your system manager.
 
This footnote also confirms that this email message has been swept
for the presence of computer viruses. 
______________________________________________________________________

Mime
View raw message