Friday 8 August 2014

Server side validation in java

html/jsp form validation in java using servlet /server side validation
public class loginvarifiservlet extends HttpServlet {


@Override
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String name=req.getParameter("un");
String psd=req.getParameter("psd");
if(name.equal("") || psd.equal(""))
{ resp.sendRedirect("login,jsp");
}
else{
resp.sendRedirect("welcomepage.jsp");}
}
}
contace me :ghorivipul97@gmail.com

No comments:

Post a Comment