Services | Updates | Contact
Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML
Search All Tutorials
Top Search: Loan Struts Open Source
OR Edge Mapping Designer
SQL Edge® not only allows you to see individual database records by executing SQL queries, but also provides a powerful
 
Getting the Log Level of a Logger
This section helps you to learn about the getting log level of a logger through the java program and illustrates how to
 
More Tutorials...

Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

 
 
Struts
Comments
 
 

 

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

                         

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

0 comments so far (post your own) View All Comments Latest 10 Comments:

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

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.

  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

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

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

Copyright © 2007. All rights reserved.