哭求一个网上订餐系统的java代码 已有零散代码 求大神组合拼装+编写
要求填写的不能为空两次密码要一样email必须包含.@不符合要求回到regist.jsp符合要求跳转到main.jspresponse.setContentType("t...
要求 填写的不能为空 两次密码要一样 email必须包含. @ 不符合要求回到regist.jsp
符合要求跳转到main.jsp
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String loginName=request.getParameter("loginName");
String loginPass=request.getParameter("loginPass");
String reLoginPass=request.getParameter("reLoginPass");
String email=request.getParameter("email");
String skill[]=request.getParameterValues("skill");
if(loginName == null || loginName.trim().equals(""))
{
request.getRequestDispatcher("regist.jsp").forward(request, response);
}
if(loginPass == null || loginPass.trim().equals(""))
{
request.getRequestDispatcher("regist.jsp").forward(request, response);
}
if(email == null || email.trim().equals(""))
{
request.getRequestDispatcher("regist.jsp").forward(request, response);
}
out.println("<hr> LoginName:" +loginName+"<br>");
out.println("LoginPass:" +loginPass+"<br>");
out.println("reLoginPass:" +reLoginPass+"<br>");
out.println("email:" +email+"<br>");
request.setAttribute("loginName",loginName);
request.setAttribute("loginPass",loginPass);
request.setAttribute("email",email);
request.getRequestDispatcher("main.jsp").forward(request, response);
}
} 展开
符合要求跳转到main.jsp
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String loginName=request.getParameter("loginName");
String loginPass=request.getParameter("loginPass");
String reLoginPass=request.getParameter("reLoginPass");
String email=request.getParameter("email");
String skill[]=request.getParameterValues("skill");
if(loginName == null || loginName.trim().equals(""))
{
request.getRequestDispatcher("regist.jsp").forward(request, response);
}
if(loginPass == null || loginPass.trim().equals(""))
{
request.getRequestDispatcher("regist.jsp").forward(request, response);
}
if(email == null || email.trim().equals(""))
{
request.getRequestDispatcher("regist.jsp").forward(request, response);
}
out.println("<hr> LoginName:" +loginName+"<br>");
out.println("LoginPass:" +loginPass+"<br>");
out.println("reLoginPass:" +reLoginPass+"<br>");
out.println("email:" +email+"<br>");
request.setAttribute("loginName",loginName);
request.setAttribute("loginPass",loginPass);
request.setAttribute("email",email);
request.getRequestDispatcher("main.jsp").forward(request, response);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询