I don't understand this. If I'm not doing a print on the getPreviousOut()
why is the body's contents going into the response?

Aren't I correct in assuming that this tag should simply ignore it's body
content?

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
        PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
        "http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd">
<taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>elasticaTags</shortname>
    <info>
        Utility tags for JSP.
    </info>
    <tag>
        <name>mail</name>
        <tagclass>com.elastica.elasticaTags.MailTag</tagclass>
        <bodycontent>tagdependent</bodycontent>
        <info>
                Mail
        </info>
        <attribute><name>recipients</name><required>true</required></attribute>
    </tag>
</taglib>

package com.elastica.elasticaTags;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.IOException;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;

public class MailTag extends BodyTagSupport
{
        private String recipients[];
        private String smtpServer[];
        private String ccRecipients[];
        private String bccRecipients[];

        public int doAfterBody () throws JspException {
                BodyContent body = getBodyContent();
                String messageText = body.getString();
                body.clearBody();

                try

                } catch (Exception ex) {
                };
                return SKIP_BODY;
        }
        /*
        public void setRecipients(String recipients) {
                //this.recipients = recipients;
        }
        public void setSmtpServer(String smtpServer) {
                //this.smtpServer = smtpServer;
        }
        public void setCCRecipients(String ccRecipients) {
                //this.ccRecipients = ccRecipients;
        }
        public void setBCCRecipients(String bccRecipients) {
                //this.bccRecipients = bccRecipients;
        }
        */
}

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to