Visit Gopalan Suresh Raj's Web Cornucopia...

Developing the E-Mail Sender Response JSP Page
Gopalan Suresh Raj

Note
To work with any of these samples, you will need the following:
.........................................JDK 1.1.7 or higher

To work with the Servlets and JSP, you will need
.........................................
JSWDK 1.0.1 or higher

To work with the Java Mail API, you will need
.........................................
JavaMail 1.1.3 or higher
.........................................
Java Activation Framework 1.0.1 or higher
.........................................
POP3 Provider 1.1.1 or higher

1. Develop the EmailContents.jsp page
Prepare the Page that will display the response, once the Servlet has processed your request.

The JSP Model 2 Architecture
(Model-View-Controller Based)

Figure shows what we are trying to ultimately accomplish in these pages here.

EmailContents.jsp
<%@ page session = "true" import="java.util.*, EmailHandler.EmailContents"%>
  <HTML>
  <head><title>Gopalan Suresh Raj's Sent Email Contents</title></head>
  <body bgcolor="#FFFFFF">
  <p align="center"><font color="#000080" size="5" face="Arial">
  Sent the following mail</font></p>
  <div align="center"><center>
  <table border="0" cellpadding="2" width="90%">
  <%
  Vector emailList = (Vector) session.getValue("EmailHandler.emailContents");
  for ( int i=0; i<emailList.size(); i++ ) {
	EmailContents emailContents = (EmailContents)emailList.elementAt(i);   
  %>
  <tr><td width="10%"><font size="3" face="Tahoma"><strong>From</strong></font></td>
  <td width="50%">
  <%= emailContents.getFrom() %>
  </td></tr>
  <tr><td width="10%"><font size="3" face="Tahoma"><strong>To</strong></font></td>
  <td width="50%">
  <%= emailContents.getTo() %>
  </td></tr>
  <tr><td width="10%"><font size="3" face="Tahoma"><strong>CC</strong></font></td>
  <td width="50%">
  <%= emailContents.getCc() %>
  </td></tr>
  <tr><td width="10%"><font size="3" face="Tahoma"><strong>BCC</strong></font></td>
  <td width="50%">
  <%=emailContents.getBcc() %>
  </td></tr>
  <tr><td width="10%"><font size="3" face="Tahoma"><strong>Subject</strong></font></td>
  <td width="50%">
  <%= emailContents.getSubject() %>
  </td></tr>
  <tr><td colspan="2" width="100%">
  <p align="center">
  <%= emailContents.getBody() %>
  </p></td></tr></table></center></div>
  <%
  }
  session.invalidate ();
  %>
  </BODY>
  </HTML> 

2. Create a Directory called "EmailHandler" on the "jswdk-1.0.1\examples\jsp\" directory and Copy this JSP page there.

click here to go to
My JSP/Servlets HomePage...

About the Author...
Gopalan Suresh Raj is a Software Architect, Developer and an active Author. He is contributing author to a couple of books "Enterprise Java Computing-Applications and Architecture" and "The Awesome Power of JavaBeans". His expertise spans enterprise component architectures and distributed object computing. Visit him at his Web Cornucopia© site (http://www.execpc.com/~gopalan) or mail him at gopalan@execpc.com.

Go to the Component Engineering Cornucopia page

This site was developed and is maintained by Gopalan Suresh Raj

This page has been visited times since September 21,1998.

Last Updated : Dec 19, '98

If you have any questions, comments, or problems regarding this site, please write to me I would love to hear from you.


Copyright (c) 1997-2000, Gopalan Suresh Raj - All rights reserved. Terms of use.

All products and companies mentioned at this site are trademarks of their respective owners.