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 image tag in html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

image tag in html

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 356
Hi,
I am going through HFSJ,chapter 1 which says that when ever the browser is rendering the html page and it comes across the image tag , it generates another HTTP request to get the resource descirbed.
I wanted to know why a new HTTP request has to be sent to server for each image tag.

java pro


SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"java pro",
it appears that you have changed your display name from one that is valid to an invalid one.

We require display names to be two wors: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct our display name, since accounts with invalid display names get deleted.

thanks,
Dave.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

A HTTP request is able to send one resource. When you request a web page, you get sent the web page. Extra 'bits' like images, fonts, favourite icons, sounds and animations are 'new' resources and they must be loaded separately with new HTTP requests.

A new HTTP request does not always require a new HTTP connection though. As a performance improvement in HTTP1.1, it supports a 'Keep-Alive' connection so that multiple requests can be sent down one connection without needing to keep establishing new connections.

Dave
Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Hi,

As David Allready told you HTTP cannot get extra bits of images and other such things in one hit, So it has to make an extra call. Also as HTTP is a stateless protocol so for every resource it has to make a seperate call to the server.

Cheers,
Rahul


Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Well, normally I would move this to the HTML forum since it is not a question about Servlets. But since there are already good responses here, I am just going to close this thread.

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: image tag in html