一起学习
public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
throws ServletException, IOException
{
boolean flag = true;
boolean flag1 = true;
boolean flag2 = true;
boolean flag3 = true;
String s5 = HttpUtils.getRequestURL(httpservletrequest).toString();
int i;
if((i = s5.indexOf("?")) > 0)
s5 = s5.substring(0, i);
String s = httpservletrequest.getQueryString();
httpservletresponse.setContentType("text/vnd.wap.wml");
PrintWriter printwriter = httpservletresponse.getWriter();
printwriter.println("");
if(s == null)
{
printwriter.println("");
printwriter.println("");
printwriter.println("
");
printwriter.println("WapMailer: Can't read template file");
printwriter.println("
");
printwriter.println("");
printwriter.println("");
printwriter.flush();
printwriter.close();
return;
}
Hashtable hashtable = getTemplate(s);
if(hashtable.size() == 0)
{
printwriter.println("");
printwriter.println("");
printwriter.println("
");
printwriter.println("WapMailer: Can't read template file");
printwriter.println("
");
printwriter.println("");
printwriter.println("");
printwriter.flush();
printwriter.close();
return;
}
flag = usedParameter("$from", hashtable);
flag1 = usedParameter("$to", hashtable);
flag2 = usedParameter("$subject", hashtable);
flag3 = usedParameter("$body", hashtable);
String s1;
if((s1 = (String)hashtable.get("FROM")) == null)
s1 = "";
else
if(s1.indexOf("$") >= 0)
s1 = "";
String s2;
if((s2 = (String)hashtable.get("TO")) == null)
s2 = "";
else
if(s2.indexOf("$") >= 0)
s2 = "";
String s3;
if((s3 = (String)hashtable.get("SUBJECT")) == null)
s3 = "";
else
if(s3.indexOf("$") >= 0)
s3 = "";
String s4;
if((s4 = (String)hashtable.get("BODY")) == null)
s4 = "";
else
if(s4.indexOf("$") >= 0)
s4 = "";
printwriter.println("");
printwriter.println("");
printwriter.println("");
printwriter.println("");
if(flag)
printwriter.println("");
else
printwriter.println("");
if(flag1)
printwriter.println("");
else
printwriter.println("");
if(flag2)
printwriter.println("");
else
printwriter.println("");
if(flag3)
printwriter.println("");
else
printwriter.println("");
printwriter.println("");
printwriter.println("");
if(flag)
printwriter.println("
From:
");
if(flag1)
printwriter.println("
To: emptyok=\"false\"/>
");
if(flag2)
printwriter.println("
Subject: "\" emptyok=\"true\"/>
");
if(flag3)
printwriter.println("
Message: "\" emptyok=\"false\"/>
");
printwriter.println("");
printwriter.println("");
printwriter.flush();
printwriter.close();
}
相关连接:
构建WAP邮件发送服务器 (一)
构建WAP邮件发送服务器 (二)
构建WAP邮件发送服务器 (三)
构建WAP邮件发送服务器 (四)
构建WAP邮件发送服务器 (五)
构建WAP邮件发送服务器 (六)
下载本文示例代码
构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)构建WAP邮件发送服务器 (三)
阅读(225) | 评论(0) | 转发(0) |