Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
16.8 Server Side Image Maps
417
ISMAP Alternative Server Side Image Maps
ISMAP
 is an optional attribute of the 
IMG
 element and can be used in a simi 
lar manner to the 
FORM
 entry. 
ISMAP
 is not
actually a 
FORM
 element at all, but can still be used for simple connections
to servlets or CGI programs. If an image with 
ISMAP
 is inside a hypertext
link, then clicking on the image results in the coordinates of the click being
sent to the specified URL. Coordinates are separated by commas and are
specified in pixels relative to the top left corner of the image. 
For instance, Listing 16.6 embeds an image that uses the 
ISMAP
 attribute
inside a hypertext link to 
http://localhost:8088/ChipTester
, which is
answered by the mini HTTP server developed in Section 16.12. Figure
16 23 shows the initial result, which is identical to what would have been
shown had the 
ISMAP
 attribute been omitted. However, when the mouse
button is pressed 271 pixels to the right and 184 pixels below the top left
corner of the image, the browser requests the URL 
http://local 
host:8088/ChipTester?271,184
 (as is shown in Figure 16 24). 
If a server side image map is used simply to select among a static set of
destination URLs, then a client side 
MAP
 element is a much better option
because the server doesn't have to be contacted just to decide which URL
applies. If the image map is intended to be mixed with other input ele 
ments, then the 
IMAGE
 input type is preferred instead. However, for a
stand alone image map where the URL associated with a region changes
frequently or requires calculation, an image with 
ISMAP
 is a reasonable
choice. 
Listing 16.6 IsMap.html 
  The ISMAP Attribute

The ISMAP Attribute

Select a pin:

Chip
     BORDER=0 ISMAP>
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

jsp web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved