You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Tim Carter <ca...@mail.com> on 2004/04/18 05:19:17 UTC
Displaying progress during a long running transaction
I'd like to do something like the following:
1. display some form to the user
2. When the form is submitted, display a progress page while the
transaction is active (search, update, whatever).
3. when the transaction is complete, display the results.
I've made several attempts using the PageRenderListener,
IRequestCycle.pageRender(..), etc with no luck.
Thanks for the help.
RE: Displaying progress during a long running transaction
Posted by Phillip Rhodes <sp...@rhoderunner.com>.
I am working on a servlet filter that will provide this functionality. I
am 2 days from having it work in all application servers. I had it
working in jetty and in tomcat, but in different ways due to how each of
these application servers use the requestwrappers.
Summary: LGPL
More info:
http://rhoderunner.com/JSPWiki/Wiki.jsp?page=LongRequestFilter
http://rhoderunner.com
> http://whatis.techtarget.com/definition/0,,sid9_gci212375,00.html
>
> An interstitial (I always spell it wrong) is the desired effect; server
> push is the technology used
> to achieve it.
>
> The term evolved from video editting.
>
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Tapestry: Java Web Components
> Creator, HiveMind
> http://howardlewisship.com
>
>
>> -----Original Message-----
>> From: Tim Carter [mailto:carter.tim@mail.com]
>> Sent: Monday, April 19, 2004 8:58 AM
>> To: Tapestry users
>> Subject: Re: Displaying progress during a long running transaction
>>
>>
>> I think this is more commonly referred to as 'server push'.
>>
>> Has anyone figured out a way to make this work within the Tapestry
>> framework ? I have had a little success by overriding the pages
>> 'renderPage' method and working directly with the
>> HttpServletResponse -
>> this seems a bit inelegant.
>>
>> Any ideas ?
>>
>> > Wow did a google on that term and only 5 pages came up. You're not
>> > making that up are you?? :-)
>> >
>> > At 11:51 PM 18/04/2004, you wrote:
>> >
>> >> This is a concept called an intersertial; it can be done,
>> but not all
>> >> browsers support it. It
>> >> involves setting a special MIME type and then streaming
>> back to the
>> >> client a series of web pages.
>> >> I've been wanting to add this ability to Tapestry since
>> 2.3 but first
>> >> I've had other priorities.
>> >> Making this kind of thing easy would be a huge selling point for
>> >> Tapestry.
>> >>
>> >> --
>> >> Howard M. Lewis Ship
>> >> Independent J2EE / Open-Source Java Consultant
>> >> Creator, Tapestry: Java Web Components
>> >> Creator, HiveMind
>> >> http://howardlewisship.com
>> >>
>> >>
>> >> > -----Original Message-----
>> >> > From: Tim Carter [mailto:carter.tim@mail.com]
>> >> > Sent: Saturday, April 17, 2004 11:19 PM
>> >> > To: tapestry-user@jakarta.apache.org
>> >> > Subject: Displaying progress during a long running transaction
>> >> >
>> >> >
>> >> > I'd like to do something like the following:
>> >> >
>> >> > 1. display some form to the user
>> >> > 2. When the form is submitted, display a progress page while the
>> >> > transaction is active (search, update, whatever).
>> >> > 3. when the transaction is complete, display the results.
>> >> >
>> >> > I've made several attempts using the PageRenderListener,
>> >> > IRequestCycle.pageRender(..), etc with no luck.
>> >> >
>> >> > Thanks for the help.
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail:
>> tapestry-user-unsubscribe@jakarta.apache.org
>> >> For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>> >
>> >
>> >
>> > Glen Stampoultzis
>> > gstamp@iinet.net.au
>> > http://members.iinet.net.au/~gstamp/glen/
>> >
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Displaying progress during a long running transaction
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
http://whatis.techtarget.com/definition/0,,sid9_gci212375,00.html
An interstitial (I always spell it wrong) is the desired effect; server push is the technology used
to achieve it.
The term evolved from video editting.
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components
Creator, HiveMind
http://howardlewisship.com
> -----Original Message-----
> From: Tim Carter [mailto:carter.tim@mail.com]
> Sent: Monday, April 19, 2004 8:58 AM
> To: Tapestry users
> Subject: Re: Displaying progress during a long running transaction
>
>
> I think this is more commonly referred to as 'server push'.
>
> Has anyone figured out a way to make this work within the Tapestry
> framework ? I have had a little success by overriding the pages
> 'renderPage' method and working directly with the
> HttpServletResponse -
> this seems a bit inelegant.
>
> Any ideas ?
>
> > Wow did a google on that term and only 5 pages came up. You're not
> > making that up are you?? :-)
> >
> > At 11:51 PM 18/04/2004, you wrote:
> >
> >> This is a concept called an intersertial; it can be done,
> but not all
> >> browsers support it. It
> >> involves setting a special MIME type and then streaming
> back to the
> >> client a series of web pages.
> >> I've been wanting to add this ability to Tapestry since
> 2.3 but first
> >> I've had other priorities.
> >> Making this kind of thing easy would be a huge selling point for
> >> Tapestry.
> >>
> >> --
> >> Howard M. Lewis Ship
> >> Independent J2EE / Open-Source Java Consultant
> >> Creator, Tapestry: Java Web Components
> >> Creator, HiveMind
> >> http://howardlewisship.com
> >>
> >>
> >> > -----Original Message-----
> >> > From: Tim Carter [mailto:carter.tim@mail.com]
> >> > Sent: Saturday, April 17, 2004 11:19 PM
> >> > To: tapestry-user@jakarta.apache.org
> >> > Subject: Displaying progress during a long running transaction
> >> >
> >> >
> >> > I'd like to do something like the following:
> >> >
> >> > 1. display some form to the user
> >> > 2. When the form is submitted, display a progress page while the
> >> > transaction is active (search, update, whatever).
> >> > 3. when the transaction is complete, display the results.
> >> >
> >> > I've made several attempts using the PageRenderListener,
> >> > IRequestCycle.pageRender(..), etc with no luck.
> >> >
> >> > Thanks for the help.
> >> >
> >> >
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >
> >
> >
> > Glen Stampoultzis
> > gstamp@iinet.net.au
> > http://members.iinet.net.au/~gstamp/glen/
> >
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Displaying progress during a long running transaction
Posted by Tim Carter <ca...@mail.com>.
I think this is more commonly referred to as 'server push'.
Has anyone figured out a way to make this work within the Tapestry
framework ? I have had a little success by overriding the pages
'renderPage' method and working directly with the HttpServletResponse -
this seems a bit inelegant.
Any ideas ?
> Wow did a google on that term and only 5 pages came up. You're not
> making that up are you?? :-)
>
> At 11:51 PM 18/04/2004, you wrote:
>
>> This is a concept called an intersertial; it can be done, but not all
>> browsers support it. It
>> involves setting a special MIME type and then streaming back to the
>> client a series of web pages.
>> I've been wanting to add this ability to Tapestry since 2.3 but first
>> I've had other priorities.
>> Making this kind of thing easy would be a huge selling point for
>> Tapestry.
>>
>> --
>> Howard M. Lewis Ship
>> Independent J2EE / Open-Source Java Consultant
>> Creator, Tapestry: Java Web Components
>> Creator, HiveMind
>> http://howardlewisship.com
>>
>>
>> > -----Original Message-----
>> > From: Tim Carter [mailto:carter.tim@mail.com]
>> > Sent: Saturday, April 17, 2004 11:19 PM
>> > To: tapestry-user@jakarta.apache.org
>> > Subject: Displaying progress during a long running transaction
>> >
>> >
>> > I'd like to do something like the following:
>> >
>> > 1. display some form to the user
>> > 2. When the form is submitted, display a progress page while the
>> > transaction is active (search, update, whatever).
>> > 3. when the transaction is complete, display the results.
>> >
>> > I've made several attempts using the PageRenderListener,
>> > IRequestCycle.pageRender(..), etc with no luck.
>> >
>> > Thanks for the help.
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
> Glen Stampoultzis
> gstamp@iinet.net.au
> http://members.iinet.net.au/~gstamp/glen/
>
Re: Displaying progress during a long running transaction
Posted by Luc Peerdeman <lj...@xs4all.nl>.
Hi all,
As a very low tech solution to the problem you could imagine an
interstitial appearing after clicking on some link, saying: "this will
take some time" and with a "I don't mind, continue" button or link.
As Tapestry buffers its output, the result of the expensive operation
would appear only after everything is done (ie the interstitial page
would not disappear right after the click on the continue button).
Now suppose the interstitial contains instead a nice graphic suggesting
progress (I am thinking of the nice animated gifs in the WSAD 5 admin
console), and somehow manages to 'click the continue button' itself (by
a redirect, or something done from the onload function, I don't know how
this would be done best).
Wouldn't this be what we are looking for ? Of course without a visible
button or link and preferably as a component that can be used in
cycle.activate(), a bit like this:
interstitial.setTarget( actualTarget);
cycle.activate( interstitial);
By the way, I have only just started using Tapestry, and I really like
it. I did some things with WebObjects long ago, and liked the higher
productivity I had with it. Working with Jsp's etc felt like a big step
backwards, so I sort of gave up on web development. With Tapestry I
think it is possible to again develop webapps with decent speed - and
with fun actually ! Friday I whipped up a page with a report in a Table,
and was amazed at how simple this was (of course also thanks to the nice
Table and DatePicker componets I could use). This is starting to feel
like decent software development again !
Luc.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Displaying progress during a long running transaction
Posted by "Kevin C. Dorff" <kd...@kcp.com>.
I had the problem that the user is on a page, lets call it Query. Query
has a form. When the form is posted, it can take a LONG time to perform
the action (1 second - several minutes). I didn't need a "pretty" way to
show I was working, so in my solution it just outputs some HTML and
contines to add more HTML to the page as progress is made... like
Computing results
10%
20%
30%
70%
90%
Done... Redirecting.
So you can imgine what the user sees but when you see the "Done...
Redirecting." the user is then redirected back to the Query page that
has the form and the results below in a table.
The way I did this was to create the Query page pretty much as normal,
but, in the form posting listener, I do a
throw new RedirectException("app?service=querySearchService");
and I create a new service (named querySearchService) that does the
actual searching. That service obtains the HttpSerletResponse object via
HttpServletResponse response = cycle.getRequestContext().getResponse();
Then creates the framework for the page to automatically go back to the
Query page when it is finished via...
response.setContentType("text/html");
Writer out = response.getWriter();
response.setContentType("text/html");
out.write("<html><head><title>MyApp -
QuerySearchService</title></head>");
out.write("<body
onload='location.href=\"app?service=page/Query\"'>");
out.write("<p>Calculating Query...</p>");
response.flushBuffer();
//Run search
QueryDb.runSearch(response, out);
out.write("</body></html>");
response.flushBuffer();
So I do frequent response.flushBuffer() to send the results out to the
user. In the QueryDb.runSearch() I am passing the "response" and "out"
so the runSearch method can do out.write(...) and response.flushBuffer()
after it writes status messages to the user.
You can see there is a <body onload="..."> in the HTML to redirect back
to the Query page when the computation is complete.
This is probably not the best way to do this, BUT, it works well for my
app and is the only way I figured out to do it.
Kevin
Glen Stampoultzis wrote:
> Wow did a google on that term and only 5 pages came up. You're not
> making that up are you?? :-)
>
> At 11:51 PM 18/04/2004, you wrote:
>
>> This is a concept called an intersertial; it can be done, but not all
>> browsers support it. It
>> involves setting a special MIME type and then streaming back to the
>> client a series of web pages.
>> I've been wanting to add this ability to Tapestry since 2.3 but first
>> I've had other priorities.
>> Making this kind of thing easy would be a huge selling point for
>> Tapestry.
>>
>> --
>> Howard M. Lewis Ship
>> Independent J2EE / Open-Source Java Consultant
>> Creator, Tapestry: Java Web Components
>> Creator, HiveMind
>> http://howardlewisship.com
>>
>>
>> > -----Original Message-----
>> > From: Tim Carter [mailto:carter.tim@mail.com]
>> > Sent: Saturday, April 17, 2004 11:19 PM
>> > To: tapestry-user@jakarta.apache.org
>> > Subject: Displaying progress during a long running transaction
>> >
>> >
>> > I'd like to do something like the following:
>> >
>> > 1. display some form to the user
>> > 2. When the form is submitted, display a progress page while the
>> > transaction is active (search, update, whatever).
>> > 3. when the transaction is complete, display the results.
>> >
>> > I've made several attempts using the PageRenderListener,
>> > IRequestCycle.pageRender(..), etc with no luck.
>> >
>> > Thanks for the help.
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
> Glen Stampoultzis
> gstamp@iinet.net.au
> http://members.iinet.net.au/~gstamp/glen/
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Displaying progress during a long running transaction
Posted by Glen Stampoultzis <gs...@iinet.net.au>.
Wow did a google on that term and only 5 pages came up. You're not making
that up are you?? :-)
At 11:51 PM 18/04/2004, you wrote:
>This is a concept called an intersertial; it can be done, but not all
>browsers support it. It
>involves setting a special MIME type and then streaming back to the client
>a series of web pages.
>I've been wanting to add this ability to Tapestry since 2.3 but first I've
>had other priorities.
>Making this kind of thing easy would be a huge selling point for Tapestry.
>
>--
>Howard M. Lewis Ship
>Independent J2EE / Open-Source Java Consultant
>Creator, Tapestry: Java Web Components
>Creator, HiveMind
>http://howardlewisship.com
>
>
> > -----Original Message-----
> > From: Tim Carter [mailto:carter.tim@mail.com]
> > Sent: Saturday, April 17, 2004 11:19 PM
> > To: tapestry-user@jakarta.apache.org
> > Subject: Displaying progress during a long running transaction
> >
> >
> > I'd like to do something like the following:
> >
> > 1. display some form to the user
> > 2. When the form is submitted, display a progress page while the
> > transaction is active (search, update, whatever).
> > 3. when the transaction is complete, display the results.
> >
> > I've made several attempts using the PageRenderListener,
> > IRequestCycle.pageRender(..), etc with no luck.
> >
> > Thanks for the help.
> >
> >
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/
RE: Displaying progress during a long running transaction
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
This is a concept called an intersertial; it can be done, but not all browsers support it. It
involves setting a special MIME type and then streaming back to the client a series of web pages.
I've been wanting to add this ability to Tapestry since 2.3 but first I've had other priorities.
Making this kind of thing easy would be a huge selling point for Tapestry.
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components
Creator, HiveMind
http://howardlewisship.com
> -----Original Message-----
> From: Tim Carter [mailto:carter.tim@mail.com]
> Sent: Saturday, April 17, 2004 11:19 PM
> To: tapestry-user@jakarta.apache.org
> Subject: Displaying progress during a long running transaction
>
>
> I'd like to do something like the following:
>
> 1. display some form to the user
> 2. When the form is submitted, display a progress page while the
> transaction is active (search, update, whatever).
> 3. when the transaction is complete, display the results.
>
> I've made several attempts using the PageRenderListener,
> IRequestCycle.pageRender(..), etc with no luck.
>
> Thanks for the help.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org