FileDocCategorySizeDatePackage
AjaxSignupServlet.javaAPI DocExample1636Wed Apr 05 20:05:26 BST 2006com.oreilly.ajax.servlet

AjaxSignupServlet

public class AjaxSignupServlet extends HttpServlet

Fields Summary
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)

        ServletContext sc = getServletContext();
        RequestDispatcher rd = null;
        User user = new User();
        user.setUsername(req.getParameter("username"));
        user.setFirstName(req.getParameter("firstname"));
        user.setLastName(req.getParameter("lastname"));
        user.setEmail(req.getParameter("email"));
        user.setPassword(req.getParameter("password"));
        user.setAddress(req.getParameter("address"));
        user.setCity(req.getParameter("city"));
        user.setState(req.getParameter("state"));
        user.setZipCode(req.getParameter("zipcode"));
        if(UserManager.addUser(user))
        {
            rd = sc.getRequestDispatcher("/confirmation.html");
            rd.forward(req, res); 
        }
		else 
        {
            rd = sc.getRequestDispatcher("/failure.html");
            rd.forward(req, res);
		}