请帮我 。如何使用 servlet 验证表单。我做了所有的servlet,但它什么也没做。我的概念是,如果任何文件为空/空,则意味着它会重定向到注册表单,否则它将在数据库中更新
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body bgcolor="##09874##">
<form method="post" action="insertData">
Employee id <input type="text" name="username" value=""><br><br>
Password <input type="password" name="password" value=""><br><br>
Confirm Password <input type="password" name="cpassword" value=""><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>