I do check in with a servlet, it works.
How validation of form filling?开发者_开发知识库 For example, re-send the user to .jsp-file, if a username is already registered?
Sorry for bad english.
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// fetch the username that was sent in the request
String username = request.getParameter("username");
// TODO: verify if the username is taken in the database
// based on the results set the value
request.setAttribute("isUsernameTaken", "true");
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/register.jsp");
dispatcher.forward(request, response);
}
精彩评论