我有source.jsp
带有表单的 jsp 页面(例如,):
<html>
<head>
<body>
<form action="Servlet123" method="POST">
// form fileds ...
</form>
</body>
</head>
</html>
doPost
以及servlet中的要求-
@WebServlet("/Servlet123")
public class Servlet123 extends HttpServlet {
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
//use with requset...
}
}
我怎样才能让页面(在这种情况下 - source.jsp
)向这个 servlet 发送请求?请求/会话中有方法吗?