package service;
import dao.UserDao;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class loginServlet extends HttpServlet
{
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException
    {
        String userName = request.getParameter("username");
        String passWord = request.getParameter("password");

        UserDao userDao = new UserDao();
        if(userName != null && passWord!=null )
        {
            if(userDao.isUserExist(userName,passWord))
            {
                request.setAttribute("info", "Congratulations! login successfully!");
            }else
                {
                request.setAttribute("info", "Sorry! this user no exists!"+userName + " " + passWord);
            }
        }
        //forward to mainSystem.jsp
        request.getRequestDispatcher("mainSystem.jsp").forward(request, response);
    }
}
最近下载更多
2017143155  LV12 2023年6月30日
495997956  LV1 2023年6月15日
000666  LV10 2022年12月24日
与哲rhcy  LV6 2022年12月4日
wangchengwen  LV15 2021年6月3日
园林属于  LV7 2021年5月27日
live1018  LV12 2021年5月24日
luchen  LV6 2021年3月23日
myy1111  LV3 2021年2月23日
唯你不离不弃  LV5 2021年1月21日
最近浏览更多
ITkuangren  LV8 2023年10月7日
hongdongdong  LV12 2023年9月3日
nbzhou2013  LV14 2023年8月4日
2017143155  LV12 2023年6月30日
gyuguigiu  LV1 2023年6月27日
mrcao95  LV2 2023年6月26日
训码士 2023年6月17日
暂无贡献等级
495997956  LV1 2023年6月15日
Merdan_810 2023年6月9日
暂无贡献等级
xxx520520  LV6 2023年5月31日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友