File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Dynamic page content using out.flush() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Dynamic page content using out.flush()" Watch "Dynamic page content using out.flush()" New topic
Author

Dynamic page content using out.flush()

Jan Ivanov
Greenhorn

Joined: Jul 20, 2006
Posts: 19
Hi !

I need to show a progress in my servlet.
I have a form and input type text in which I want to show the percentage stage of my process.


Here is sample code:



Why it's not working. I get on the screen only last step of the iteration ?

Pls help Me !!

[ July 20, 2006: Message edited by: input output ]
[ July 20, 2006: Message edited by: Jan Ivanov ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Hi Mr Output
Please read the Naming Policy of the ranch first.
http://www.javaranch.com/name.jsp

Thank you.


[My Blog]
All roads lead to JavaRanch
Jan Ivanov
Greenhorn

Joined: Jul 20, 2006
Posts: 19
Reading Naming Policy is done
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

It seems a bit weird to send <script> tags to the client and to hope for the page to be updated.
I've never looked into that, but did you try to search about Pushlets ?
Jan Ivanov
Greenhorn

Joined: Jul 20, 2006
Posts: 19
It works only if page has only that one form in BODY tag.
If I put that form in TABLE it won't work. (???)
I think that problem is in out.flush().
I don't know how does it work. When I should call this method ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Really ?
did you try this way :
Jan Ivanov
Greenhorn

Joined: Jul 20, 2006
Posts: 19
It works now !
Have to close all TABLES tags before calling flush.
Very strange.

Thanks a lot !
Hayk Baghdasaryan
Greenhorn

Joined: Jul 20, 2006
Posts: 2


This code must work

[ July 20, 2006: Message edited by: Hayk Baghdasaryan ]
[ July 20, 2006: Message edited by: Hayk Baghdasaryan ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic page content using out.flush()
 
Similar Threads
embedded js file in doGet
Disabling a href=...
Javascript to Java
making readonly form fields editable dynamically
Reading Multiple files by single submit