AW: Execute method automatically after page has been loaded and shown to user

2005-12-07 Thread andreas.mitter
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:[EMAIL PROTECTED]
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, [EMAIL PROTECTED] [EMAIL PROTECTED] 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.
__


AW: Execute method automatically after page has been loaded and shown to user

2005-12-07 Thread andreas.mitter
Hi Alexander!

I just don't exactly know what you mean.

In my JSF there should be a meta tag, that refreshes the page only one time 
depending on a session attribute?
I don't know how to do that the connection will be build at first, when the 
refresh starts (when the page will be rendered the second time) and not when 
the page will be rendered the first time?

Regards,
Andy



-Ursprüngliche Nachricht-
Von: Jesse Alexander (KBSA 21)
[mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 7. Dezember 2005 10:38
An: MyFaces Discussion
Betreff: RE: Execute method automatically after page has been loaded and
shown to user


Hi Andy

Have you thought about using the refresh-meta-tag?

You could render the page on first visit with a refresh header set to 1 second. 
The page would be rendered reading --- please wait --- and in the background 
initiate
a new request which then would build the connection, and render a new page...

A flag in the session could signal to your code whether the redirection is 
needed or not.

Advantages I see:
- standard request-processing
- the user would see the browser activity and could conclude: ok, something is 
being 
  processed

hth
Alexander

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 07, 2005 10:29 AM
To: users@myfaces.apache.org
Subject: AW: Execute method automatically after page has been loaded and shown 
to user

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:[EMAIL PROTECTED]
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, [EMAIL PROTECTED] [EMAIL PROTECTED] 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. 
__


__

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.
__