Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old August 22nd, 2005, 04:22 AM
Registered User
Join Date: Aug 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting the response Content

Hi ,

I am doing the image retrieval from the server. here i need a progress bar which will show the progress information of the image retrieval.

i feel that if i set the contentlength in the HttpServletResponse object , the i can get total object which is coming over the network.
i kept the code like this


here image is my own object. which is having some size. so at the client side

URL url=new URL("http://localhost/servlet/ServerServlet");
URLConnection con=url.openConnection();
long length=con.getContentLength();
System.out.println("The content length is"+length);

so here i am getting the contentlength is -1, though i specified the content length as image size.

please tell me how to get the progressbar while retriving the image from the server. and the contentlength which i specified.


Reply With Quote
  #2 (permalink)  
Old September 22nd, 2005, 12:04 PM
Registered User
Join Date: Sep 2005
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

progress bar is the classic thread test.
you need to have a LOW_PRIORITY thread running in your server which is responsible on image retrieving, while the main thread which is the servlet is returning the results, the servlet should keep sending the current result until the low priority thread finishs retrieving.

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Active Content in Browser setting taraprasad Pro JSP 0 February 1st, 2008 04:41 AM
Setting Content Name amitchopra8 J2EE 0 July 25th, 2005 02:11 AM
setting content type of asp generated xml whyulil Classic ASP XML 0 July 15th, 2005 04:50 AM
Setting Response encoding in ASP.Net jaswantsinghrana VS.NET 2002/2003 0 July 22nd, 2003 04:30 AM

All times are GMT -4. The time now is 06:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.