⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subscribe_jsp.java

📁 Email营销是在用户事先许可的前提下
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.qq.content.*;

public final class subscribe_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=gbk");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
      com.qq.content.TempUsersManager tempuser = null;
      synchronized (application) {
        tempuser = (com.qq.content.TempUsersManager) _jspx_page_context.getAttribute("tempuser", PageContext.APPLICATION_SCOPE);
        if (tempuser == null){
          tempuser = new com.qq.content.TempUsersManager();
          _jspx_page_context.setAttribute("tempuser", tempuser, PageContext.APPLICATION_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      com.qq.content.MailSender mailsender = null;
      synchronized (application) {
        mailsender = (com.qq.content.MailSender) _jspx_page_context.getAttribute("mailsender", PageContext.APPLICATION_SCOPE);
        if (mailsender == null){
          mailsender = new com.qq.content.MailSender();
          _jspx_page_context.setAttribute("mailsender", mailsender, PageContext.APPLICATION_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      com.qq.content.UsersManager um = null;
      synchronized (application) {
        um = (com.qq.content.UsersManager) _jspx_page_context.getAttribute("um", PageContext.APPLICATION_SCOPE);
        if (um == null){
          um = new com.qq.content.UsersManager();
          _jspx_page_context.setAttribute("um", um, PageContext.APPLICATION_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "header.jsp", out, false);
      out.write('\r');
      out.write('\n');
 
String mailbox = request.getParameter("mailbox");
String operation = request.getParameter("operation");
String source = request.getParameter("source");
String [] temp= new String[20];
String show = "";
String IP = request.getRemoteAddr();//得到客户端的IP地址,以便记录
System.out.println(IP);
int num=0;
for(int i=0;i<com.qq.content.serviceSet.getServicesNumber();i++){
	String serv=request.getParameter("service"+i);
	if(serv!=null && serv.length()>0)temp[num++]=serv;
	System.out.println("add service: "+serv);
}

String[] services=new String[(num==0?1:num)];

for(int i=0;i<num;i++){
	services[i]=temp[i];
}

if((mailbox!=null)&&(mailbox.length()!=0)&&(operation!=null))
{

	if(source==null)	 source="";
	if(num>0)//至少选择了其中一项服务
	{		
		if((mailbox.indexOf("@")!=-1)&&(mailbox.indexOf(".")!=-1)){//初步判断邮箱格式正确
			if(!(operation.equals("quit"))){
				try{	
					if(tempuser.Submit(mailbox,services,source)){							
							int ret = mailsender.sendAssureMail(mailbox, services);
							if (ret == 0){//邮件发送成功
								show = "已经向您发送一封确认邮件,请您点击邮件中的链接,即可成功完成订阅。";
							}
							else if(ret == -1)//邮件发送失败
								show = "发送邮件失败,请检查您的信箱格式是否正确";
							else //其他原因
								show = "对不起,系统忙,发送确认邮件失败,请您稍后再试。";
						}
						else
							show = "对不起,系统忙,请您稍后再试...";
				}					
				catch(Exception e)
				{
					System.out.println(e.getMessage());
					show = "对不起,系统现在忙,请您稍后订阅。";
				}
			}
			else{
				try{	
					if(um.canQuit(mailbox,services)==true){
						int ret = mailsender.sendAssureQuitMail(mailbox, services);						
						if (ret == 0){
							//tempuser.addQuitSentNum(1,"mms");
							show = "已经向您发送一封确认邮件,请您点击邮件中的链接,即可成功完成退订。";
						}
						else if(ret == -1)
							show = "发送邮件失败,请检查您的信箱格式是否正确";
						else
							show = "对不起,系统忙,发送确认邮件失败,请您稍后再试。";
					}
					else show = "对不起,你不能取消您未订制的服务...";
				}
				catch(Exception e)
				{
					System.out.println(e.getMessage());
					show = "对不起,系统现在忙,请您稍后再退订。";
				}				
			}
		}
		else{
			show = "邮箱格式不正确,请您检查";
		}
	}
	else{
		show = "您必须选择一种服务";
	}
}
else
{
	show = "邮箱不能为空";
}

      out.write("\r\n");
      out.write("<br>\r\n");
      out.write("<div class=\"mainbar4\" id=\"boardmaster\">\r\n");
      out.write("<div id=\"boardmanage\"></div>\r\n");
      out.write("<div style=\"float:center;text-indent:5px;\" id=\"masterpic\"></div><center>系统提示</center>\r\n");
      out.write("</div>\r\n");
      out.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"text-indent:0px; \r\n");
      out.write("border: 1px solid #6595d6;\r\n");
      out.write("width : 98%;min-width :760px;margin : 0 auto;background-color :buffonface;\">\r\n");
      out.write("  <tr><TD height=20></TD></tr>\r\n");
      out.write("  <tr >\r\n");
      out.write("   <td   style=\"border-bottom : 0px; width : 98%;min-width :760px;margin : 0 auto;\r\n");
      out.write("      background-color : buffonface;font-size : 12px;line-height : 20px; text-align : center;text-indent: 5px;\">      \r\n");
      out.write("   <br>");
      out.print(show);
      out.write("<br><br><br>   \r\n");
      out.write("   </td>\r\n");
      out.write(" </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<br>\r\n");
      out.write("\r\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "footer.html", out, false);
      out.write('\r');
      out.write('\n');
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -