案例,用户名和密码
(这是JSP的代码)
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>登录界面</title>
</head>
<body>
<h1>用户登录</h1>
<hr>
<%--前端页面发送请求的时候,请求路径以"/"开始,带项目名。 --%>
<form action="<%=request.getContextPath()%>/login" method="post">
<label for="username">用户名:</label><input type="text" id="username" name="username"><br>
<label for="password">密码:</label><input type="password" id="password" name="password"><br>
<input type="submit" value="login">
</form>
</body>
</html>