Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package SignUp;
- import java.io.IOException;
- import java.io.PrintWriter;
- import javax.servlet.ServletException;
- import javax.servlet.annotation.WebServlet;
- import javax.servlet.http.HttpServlet;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
- @WebServlet(urlPatterns = "/signup.do")
- public class SignUpServlet extends HttpServlet{
- private static final Logger logger = LogManager.getLogger("SignUp");
- protected void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException,IOException
- {
- logger.error("signup");
- request.getRequestDispatcher("/WEB-INF/views/signUp.jsp").forward(request, response);
- }
- protected void doPost(HttpServletRequest request, HttpServletResponse response)
- throws ServletException,IOException
- {
- PrintWriter out = response.getWriter();
- String userName = request.getParameter("username");
- String password = request.getParameter("password");
- String email = request.getParameter("email");
- String phone = request.getParameter("phone");
- SignUpService service = new SignUpService();
- if(service.customerSignUp(userName, password, email, phone)>0)
- {
- out.print("You are successfully registered");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement