Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (26.52 KB, 13 trang )
The JSP Files (part 8): Tagged And Bagged
By Vikram Vaswani and Harish Kamath
This article copyright Melonfire 2000−2002. All rights reserved.
Table of Contents
The Beginning Of The End................................................................................................................................1
Playing Tag..........................................................................................................................................................2
Looking Inside.....................................................................................................................................................3
Meeting Popeye...................................................................................................................................................4
You've Got Mail!.................................................................................................................................................7
Applet Antics.......................................................................................................................................................9
The JSP Files (part 8): Tagged And Bagged
i
The Beginning Of The End
Over the past few weeks, we've taken you on a guided tour of the intricacies of JSP, beginning with basics
like conditional statements and loops, and quickly moving on to more complex things like form processing,
session management, and error handling.
But all good things must come to an end − and so, in this final episode of The JSP Files, we'll be briefly
touching on a few other facets of this powerful server−side scripting language.
The Beginning Of The End 1
Playing Tag
One of the most exciting features about JSP is the ability to build and use custom "tag libraries" in your JSP
applications. A "tag library" is a reusable block of JSP code, typically written to replace Java code with
easy−to−read−and−understand tags (similar in appearance to HTML markup). Once written, these tag
libraries can be used over and over again, thereby bringing a new element of reusability to the language.
In addition to reusability, tag libraries also offer substantial advantages from the maintenance point of view.
Since tag libraries are largely defined using XML−type markup, they make it possible to separate application
presentation from application logic − which, in turn, implies that designers and developers working on Web
applications can use a tag without worrying about how and why it works. This separation between program
code and final layout is something most designers would kill to have − and it's now available to almost anyone
who knows how to string together Java and JSP code.
Another advantage of the separation discussed above, is the ease of use when it comes to adding new features