Frameworks| Hibernate| Struts| JSF| JavaFX| Ajax| Spring| DOJO| JDO| iBatis| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Img Tag: 
 

html:img Tag : Renders an HTML element with the image at the specified URL. This tag allows dynamic generation of an image as specified attributes of this tag.

 

Img Tag<html:img>:

                         

html:img Tag : Renders an HTML <img> element with the image at the specified URL. This tag allows dynamic generation of an image as  specified attributes of this tag.

Note: The base URL for this image is calculated directly based on the value specified in src, page, or action or page, or indirectly by looking up a message resource string based on the srcKey or pageKey attributes.
* There must be specified exactly one of these attributes.
     

 

 

 

 

      

Name Description
border

This attribute specifies the width of the border surrounding the image.

name

The name  attribute specifies The  JSP bean that contains a Map representing the query parameters (if property is not specified), or a JSP bean whose property getter is called to return a Map (if property is specified).

page

The module-relative path, starting with a slash, of the image to be displayed by this tag. The rendered URL for this image will automatically prepend the context path of this web application (in the same manner as the page attribute on the link tag works), in addition to any necessary URL rewriting. You must specify either the page attribute or the src attribute.

action

The action, starting with a slash, that will render the image to be displayed by this tag. The rendered URL for this image will automatically prepend the context path of this web application (in the same manner as the action attribute on the link tag works), in addition to any necessary URL rewriting. You must specify the action, page attribute or the src attribute.
Additionally, you can specify a module prefix for linking to other modules.

property

The name of a property of the bean specified by the name attribute, whose return value must be a java.util.Map containing the query parameters to be added to the src URL. You must specify the name attribute if you specify this attribute.

scope

Specified the scope within which to search for the bean specified by the name attribute. If not specified, all scopes are searched.

width

This attribute provides the width of the image being displayed. This parameter is very nice to specify (along with height) to help the browser render the page faster.

Example Illustrating the use of the Rewrite<html:img> tag :
Here you will learn to use the Struts Html  <html:img>tags. 
We will cover an example that will show a working of<html:img>tags

Example code :
Creating an Action Class                                                : Not Required here.
Creating Form Bean                                                       : Not Required here.
Defining the global-forwards                                           : Not Required here.
Developing the Action Mapping in the struts-config.xml   : Not Required here.


Developing the HtmlImageTag.jsp page :

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
     <body bgcolor="#999933">       
        <h3><font color="#FFFF33">HTML IMAGE TAG DEMO</font></h3>
        <html:img page="/images/servicesbanner.gif" width="20%" border="2"/>
    </body>
</html>

Add the following line in the index.jsp to call the form.
<a href=" HtmlImageTag.jsp"> HtmlImageTagDemo</a><br/> 

Building and Testing the Example  :
Build , deploy and Test  the application . 
Open the browser and navigate to the HtmlImageTag.jsp page. 
Your browser displays the following page HtmlImageTag.jsp and see the output .

 


Above Demo  displays the working of  <html:img>tag.

                         
» View all related tutorials
Related Tags: html c ide orm text form nested textarea tag this id element tar create tex for to ext e area

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.