Java
  Home arrow Java arrow Page 7 - The JSP Files (part 1): Purple Pigs In...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

The JSP Files (part 1): Purple Pigs In A Fruitbasket
By: Vikram Vaswani and Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 9
    2001-02-07

    Table of Contents:
  • The JSP Files (part 1): Purple Pigs In A Fruitbasket
  • Studying The Foundations
  • Java In A Teacup
  • Enter John Doe
  • Putting Two And Two Together
  • Basket Case
  • Alphabet Soup For The Soul

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    The JSP Files (part 1): Purple Pigs In A Fruitbasket - Alphabet Soup For The Soul


    (Page 7 of 7 )

    If you've used C before, you're probably already familiar with the "include" directive that appears near the beginning of every C program. JSP supports an equivalent include() function, which does much the same thing. Take a look at this simple example:


    <html> <head> <title> Thought For The Day</title> </head> <body> Thought For The Day: <br> <%@ include file="thought.html" %> </body> </html>

    [thought.html]

    Ever wonder if illiterate people get the full effect of alphabet soup?

    In this case, JSP will automatically read the contents of the file "thoughts.html", and display a composite page which looks like this:

    <html> <head> <title> Thought For The Day</title> </head> <body> Thought For The Day: <br> Ever wonder if illiterate people get the full effect of alphabet soup? </body> </html>

    A very useful and practical application of the include() function is to use it to include a standard footer or copyright notice across all the pages of a Web site, like this:

    <html> <head> </head> <body> ...your HTML page... <br> <%@ include file="footer.html" %> </body> </html>

    where "footer.html" contains

    <font size=-1 face=Arial>This material copyright Melonfire, 2001. All rights reserved.</font>

    Now, this footer will appear on each and every page that contains the include() statement above - and, if you need to change the message, you only need to edit the single file named "footer.html"!

    And that's about it for this week. We've shown you the basic building blocks of JSP, and next time, we'll be using those fundamental concepts to demonstrate JSP's control structures. Don't miss it!
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

       

    JAVA ARTICLES

    - Adding Images With iTextSharp
    - Adding Columns With iTextSharp
    - Creating Simple PDF Files With iTextSharp
    - The Spring Framework: Understanding IoC
    - Introducing the Spring Framework
    - Java Classes
    - Completing the Syntactic Comparison of Java ...
    - Syntactic Comparison of Java and C/C++
    - Java Statements
    - Conditionals, Expressions and Other Java Ope...
    - Java Operators
    - Primitive Data Types and Basic Language Rule...
    - Java and Object-Oriented Programming
    - Java Beginning Programming
    - Gaming Development Setup

    SlickEdit




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway