Home arrow Java & J2EE arrow Page 5 - The JSP Files (part 8): Tagged And Bagged

You've Got Mail! - Java

One of the most exciting features about JSP is the ability tobuild and use custom "tag libraries" in your JSP applications. In thisarticle, find out why tag libraries are a Good Thing, and read about how toget and install custom tag libraries for common tasks.

  1. The JSP Files (part 8): Tagged And Bagged
  2. Playing Tag
  3. Looking Inside
  4. Meeting Popeye
  5. You've Got Mail!
  6. Applet Antics
By: Vikram Vaswani and Harish Kamath, (c) Melonfire
Rating: starstarstarstarstar / 5
June 11, 2001

print this article


Now, our original thesis was that tag libraries would allow Web designers with no knowledge of JSP to implement complex functionality on a Web page. While the examples you've just seen were simple and illustrative, they haven't really proved that thesis - after all, it's reasonable to suppose that any competent Web designer would know how to manipulate date and time values via JavaScript and wouldn't really require a tag library for the purpose. So let's try something most client-side specialists wouldn't know how to handle - email delivery.

Typically, the process of generating email from a Web site is handled via a server-side script - Perl gurus open a pipe to sendmail, while PHP programmers reach for the mail() function. This implies a foreknowledge of either PHP or Perl - not something a novice Web designer may be expected to possess. What solution does JSP offer this poor soul?

The Jakarta MAILER library.

Using a couple of simple tags from this library, any Web developer can quickly add mail-processing capability to a Web page - in fact, the process is simpler than the equivalent techniques in Perl and PHP. Take a look.

<html> <head> </head> <body> <%@ taglib uri="jspmailer" prefix="jmail" %> <jmail:mail server="mail.server.com" to="recipient@server.com" from="sender@server.com" subject="This stuff is pretty cool!"> <jmail:message> OK, you've convinced me - this tag library thing is awesome! Where do I sign up? </jmail:message> <jmail:send/> </jmail:mail> </body> </html>
By simplifying otherwise complex code, custom tag libraries like the one above can promote both efficiency and harmony in group development projects, by allowing the developers to concentrate on building better tools (libraries) and the designers to concentrate on presentation (rather than code). As JSP evolves, you can expect tag libraries to grow in importance - even now, they are by far one of the most compelling reasons to choose this server-side language over others.

>>> More Java & J2EE Articles          >>> More By Vikram Vaswani and Harish Kamath, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- More Java Bugs Lead to More Attacks
- Oracle's Java One Brings News, Surprises
- Oracle Patches Java Runtime Environment
- Apple Syncs Java Update with Oracle
- Spring 3.1 Java Development Framework Compat...
- Jelastic Java PaaS Availability and Pricing ...
- NetBeans 7.1 Released, Supports JavaFX 2
- SolarWinds Releases Newest Version of Java M...
- Free Monitoring Tool for Java Apps on Heroku
- Heroku Adds JCloud Platform Support, Java 7 ...
- Java SE 8 Speculation in Full Swing
- Java SE 7 Now Available
- New JVM Language and Java Reporting Tool
- Java 7 Release Update and New Eclipse Toolkit
- The Best Java Netbeans IDE Plugins

Developer Shed Affiliates


Dev Shed Tutorial Topics: