Package Servlet

Source Code of Servlet.AccountVerification

package Servlet;

import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javax.mail.MessagingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import DAO.JDBCUserDAO;
import Interface.UserDAOInterface;

import utility.SendMail;


/**
* Servlet implementation class AccountVerification
*/
public class AccountVerification extends HttpServlet {
  private static final long serialVersionUID = 1L;
      
    /**
     * @see HttpServlet#HttpServlet()
     */
    public AccountVerification() {
        super();
        // TODO Auto-generated constructor stub
    }

  /**
   * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
   */
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
  }

  /**
   * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
   */
  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    SendMail t = new SendMail();
    try {
      String content="Merci de vous �tres inscrit sur notre site de jeux en ligne" +
          "<br>Recapitulatif d'information :" +
          "<br> login:"+request.getParameter("login") +
          "<br> mot de pass:"+request.getParameter("pwd")+
          "<br>Cliquer <a href='http://localhost:8080/in56/AccountValidation?id="+request.getParameter("login")+"'>ici</a> pour valider votre inscription";
      t.run(request,"Validation inscription jeux IN56",content,request.getParameter("email"));
    } catch (MessagingException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    UserDAOInterface a = new JDBCUserDAO();
   
    a.create(request.getParameter("login"),request.getParameter("pwd"),request.getParameter("email"));
    request.getRequestDispatcher("index.jsp").forward(request, response);
    return;
  }
 
}
TOP

Related Classes of Servlet.AccountVerification

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.