Hi Yimei: Thank you for the nice project page. Here is a concrete proposal: can you write a JSP page that lets the user define a cd for cds that reads in a cd for the selected cd for cds and that counts the number of inheritance relationships in the cd? The program that computes the number of inheritance relationships does not have to work correctly for all possible cd for cds but for a nice number of them. This is an experiment that combines Demeter/Java with JSP to provide an "adaptive" JSP. -- Karl Code Listing
Code Listing -- FormMail.jsp
<html>

<!--
  Copyright (c) Object Productions, Inc. 

	All Rights Reserved Worldwide -- 
	License Hereby Granted for Individual Non Commercial Use
	see www.jsptutorial.com for more information

	Author: Jordan Bortz, Email: JordanB@surfnetusa.com
 
-->

<body bgcolor="white">
<font size=5 color="black">

<%@ page import="javax.servlet.http.HttpUtils" %>
<%@ page import="java.util.*" %>
<%@ page import = "java.sql.*" %>
<%@ page import = "java.io.*" %>
<%@ page import= "sun.net.smtp.SmtpClient" %>
<%
	String from,to,subject,msgbody,serverName;
 	try
		{  
        from = request.getParameterValues("from")[0];
        to = request.getParameterValues("to")[0];
        subject = request.getParameterValues("subject")[0];
        msgbody = request.getParameterValues("msgbody")[0];
        serverName = request.getParameterValues("server")[0];
		}
 	catch (Exception e)		// Generally Speaking, an Error getting one of these
							// Values means that it wasnt passed in; inform the user
   		{
		out.println("You must call this JSP from this ");
		out.println("<A href=\"FormMail.htm\"> form</A>.<BR>");
		out.flush();return;
   		}
%>

Hold On A Moment while I try to Send Your Mail...  <BR>

<%
	out.flush();
	// Here are the real guts of the mail sending
	try
		{
    	sun.net.smtp.SmtpClient sm = new sun.net.smtp.SmtpClient(serverName);
    	sm.from(from);
    	sm.to(to);
    	PrintStream msg = sm.startMessage();
    	msg.println("To: ");	   // Note dont use + for Performance
    	msg.println(to);
    	msg.println("Subject: ");
    	msg.println(subject);
    	msg.println();
    	
    	msg.println(msgbody);
    	msg.println("==============");
    	msg.print("This mail brought to you by JSP MAIL..from a user at IP ");
    	msg.println(request.getRemoteHost());
    	sm.closeServer();
    	out.println("Your Mail Has Been Sent!");
		}
	catch (Exception e)
		{
		out.println("The mail couldn't be sent, probably because the mailhost wasnt set correctly.<BR> ");
		out.println("The error message I am getting is: ");
		out.println(e.getMessage());
		}
%>
    <BR>
<BR>
<A HREF="FormMail.htm">Click here to send another!</A>