统计在线人数...

构建WAP邮件发送服务器(4)

[ 来源:转载 | 作者:佚名 | 时间:2006-5-29 下午 01:08:06 | 浏览:统计中... ]

public void doPost(HttpServletRequest httpservletrequest, HttpServletResponse 
httpservletresponse)

throws ServletException, IOException

{

PrintWriter printwriter = null;

Hashtable hashtable = null;

Hashtable hashtable1 = null;

String s = httpservletrequest.getQueryString();

httpservletresponse.setContentType("text/vnd.wap.wml");

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;

}

hashtable1 = getTemplate(s);

if(hashtable1.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;

}

if(hashtable1.get("PORT") == null || hashtable1.get("FROM") == null || 
hashtable1.get("TO") == null || hashtable1.get("MAILHOST") == null || 
hashtable1.get("DOMAIN") == null)

{

printwriter.println("");

printwriter.println("");

printwriter.println(" 

");

printwriter.println("WapMailer: Can''t send mail. Check template file");

printwriter.println("

");

printwriter.println("");

printwriter.println("");

printwriter.flush();

printwriter.close();

return;

}

hashtable = new Hashtable();

String s1;

for(Enumeration enumeration = httpservletrequest.getParameterNames(); 
enumeration.hasMoreElements(); hashtable.put(s1.toUpperCase(), 
decodeString(httpservletrequest.getParameter(s1), 
httpservletrequest.getCharacterEncoding(), (String)hashtable1.get("ENCODING"))))

s1 = (String)enumeration.nextElement();

boolean flag = letterToNet(hashtable, hashtable1);

printwriter.println("");

printwriter.println("");

printwriter.println(" 

");

if(flag)

printwriter.println("WapMailer: your message has been send");

else

printwriter.println("WapMailer: Can''t send mail");

printwriter.println("

");

printwriter.println("");

printwriter.println("");

printwriter.flush();

printwriter.close();

}


共有0人参与评价,平均得分:0分
评论内容只代表网友观点,与本站立场无关! 查看完整内容
   

当前在线人数
QQ:748838 MSN:allen_xia#msn.com E-mail:allenxia666#126.com QQ群:站长联盟北方区-北京(28200145) 站长联盟南方区-上海(67713522)