我写了个登陆页面,也写了登陆的servlet,但是测试的时候根本没有运行post方法请大佬帮我看看怎么回事代码如下login.jsp<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8" isELIgnored="false"%>
<!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=utf-8">
<title>Insert title here</title>
</head>
<body>
<center>
<h1 style="color:red">登陆</h1>
<form id="login" name="login" action="Servlet/LoginServlet" method="post">
<table border="0">
<tr>
<td>账号:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="password" name="password">
</td>
</tr>
</table>
<select id="type" name="type">
<option value="1">玩家</option>
<option value="2">店家</option>
<option value="3">管理员</option>
</select>
<br>
<input type="submit" value="登录" style="color:#BC8F8F">
</form>
<form action="regist.jsp">
<input type="submit" value="注册" style="color:#BC8F8F">
</form>
</center>
</body>
</html>LoginServletpackage Servlet;
import java.io.IOException;
import java.sql.Connection;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import DB.DBConnection;
/**
* Servlet implementation class LoginServlet
*/如上,我在post方法里写了打印语句,结果测试根本没有输出任何东西
添加回答
举报
0/150
提交
取消