SunQuest
 
       Java
  Home arrow Java arrow Page 6 - The JSP Files (part 8): Tagged And Bag...
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 8): Tagged And Bagged
By: Vikram Vaswani and Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2001-06-11

    Table of Contents:
  • The JSP Files (part 8): Tagged And Bagged
  • Playing Tag
  • Looking Inside
  • Meeting Popeye
  • You've Got Mail!
  • Applet Antics

  • 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
     
    IBM developerWorks
     
    ADVERTISEMENT

    At the virtual BlackBerry Technical Seminar 2008, you can ask your development questions directly of Research In Motion® (RIM) experts, and take advantage of learning opportunities designed uniquely for BlackBerry solution developers. Register Today!

    The JSP Files (part 8): Tagged And Bagged - Applet Antics


    (Page 6 of 6 )

    You've already seen how JSP "actions" work - in the last article, for example, we demonstrated the <jsp:useBean> and <jsp:setProperty> actions in conjunction with JavaBeans, while <jsp:include> was illustrated in the very first article in this series. However, we missed out on a couple of important ones - and so, we'd like to introduce you to <jsp:plugin>, used to incorporate Java applets into a Web page.

    The <jsp:plugin> directive takes care of generating all the HTML code necessary to embed and activate a Java applet. Consider the following example:

    <html> <head> </head> <body> <jsp:plugin type="applet" code="NewsTicker.class" name="newsticker" height="100" width="100"> <jsp:params> <jsp:param name="x" value="10"/> <jsp:param name="y" value="25"/> <jsp:param name="cx" value="90"/> <jsp:param name="cy" value="114"/> <jsp:param name="bgcolor" value="102,102,153"/> <jsp:param name="textcolor" value="0,0,0"/> <jsp:param name="hilitecolor" value="255,0,0"/> </jsp:params> <jsp:fallback>Oops! Something bad happened and I can't display this applet</jsp:fallback> </jsp:plugin> </body> </html>
    The code above sets up the applet contained in "NewsTicker.class", and passes it a bunch of name-value pairs of parameters. The
    When JSP compiles and renders the page, the code above is automatically converted to its HTML equivalent.

    <html> <head> </head> <body> <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="100" height="100" codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab #Version=1,2,2,0"> <PARAM name="java_code" value="NewsTicker.class"> <PARAM name="type" value="application/x-java-applet;"> <PARAM name="cy" value="114"> <PARAM name="cx" value="90"> <PARAM name="bgcolor" value="102,102,153"> <PARAM name="hilitecolor" value="255,0,0"> <PARAM name="y" value="25"> <PARAM name="x" value="10"> <PARAM name="textcolor" value="0,0,0"> <COMMENT> <EMBED type="application/x-java-applet;" width="100" height="100" pluginspage="http://java.sun.com/products/plugin/" java_code="NewsTicker.class" cy=114 cx=90 bgcolor=102,102,153 hilitecolor=255,0,0 y=25 x=10 textcolor=0,0,0 > <NOEMBED> </COMMENT> Oops! Something bad happened and I can't display this applet </NOEMBED></EMBED> </OBJECT> </body> </html>
    And finally, the

    <jsp:forward page="endzone.jsp" />
    Just as in the previous example, additional parameters can be passed to the new script via <jsp:param>. For example,

    <jsp:forward page="endzone.jsp"> <jsp:param name="user" value="joe" /> <jsp:param name="uid" value="653" /> <jsp:param name="gid" value="1220" /> </jsp:forward>
    And with that, it's about time to call this a wrap. We hope you enjoyed it, and that it served as a good starting point for your entry into the world of JSP.

    If you're interested in learning more about the topics discussed in this series, take a look at Sun Microsystems' JSP pages at http://java.sun.com/products/jsp/, Java documentation and references at http://java.sun.com/docs/, or the tutorial on tag libraries at http://java.sun.com/products/jsp/tutorial/TagLibrariesTOC.html. If, on the other hand, you have questions, comments, or large sums of money for us, drop us a line - we'd love to hear from you!

    Until next time...stay healthy!

    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





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