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

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Include Tag: 
 

bean:include Tag - is used to load the response from a dynamic application request and make it available as a bean.

 

Include Tag:

                         

bean:include Tag - is used to load the response from a dynamic application request and make it available as a bean.

This tag performs an internal dispatch to the specified application component (or external URL) and makes the response data available from that request as a bean of type String.

Include  tag works similar to that of the standard <jsp:include> tag, except that the response data is stored in a page scope attribute instead of being written to the output stream. If the current request is part of a session, the generated request for the include  be part of the same session.

 

 

 

 

 

Name Description
anchor

Optional anchor tag ("#xxx") to be added to the generated hyperlink. Specify this value without any "#" character.

forward

This attribute specifies the logical name of a global ActionForward that contains the actual content-relative URI of the resource to be included.

href

This attribute specifies the absolute URL (including the appropriate protocol prefix such as "http:") of the resource to be included. Because this URL could be external to the current web application, the session identifier will not be included in the request.

id

This attribute specifies , the name of the scripting variable (and associated page scope attribute) that will be made available with the value of the specified web application resource.

page

Page attribute specifies Module-relative URI (starting with a '/') of the web application resource to be included.

Example Illustrating the use of the Include<bean:include> tag.

Here you will learn to use the Struts Html  bean:include tags. 
We will cover an example that will show a working of<bean:include> 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 he
re.

Developing the beanIncludeTag.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" %>
<html>
    <head>
        <title>Demo Of struts-bean:include Tag</title>
    </head>
     <body bgcolor="#999933">
        <div align="center">
            <h2><font color="#33FF33">struts-bean:include Tag Demo</font></h2>
        </div>
        <bean:include id="IncludePageOutput" page="/IncludePage.jsp" />
        <table border="2">
        <tr><td><p><font color="#33FF33">
            Display the contents returned by invoking
               </p>
                  </font>
          </td>
       </tr>

        <tr><td>
            <pre><bean:write name="IncludePageOutput"/></pre>
        </td></tr>
    </body>
</html>
 

Add the following line in the index.jsp to call the form.

<a href="beanIncludeTag.jsp">beanIncludeTagDemo</a><br/>


Building and Testing the Example: 

Build , deploy and Test  the application . 
Open the browser and navigate to the beanIncludeTag.jsp page
Your browser displays the following page beanIncludeTag.jsp and see the output .

Output :



Above actions   displays the working of beanIncludeTag..

                         

» 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.