0
的servlet我有JoinCustomerToAccountServlet
的servlet下src/controller
-不能調用從JSP頁面的表單
@WebServlet("/JoinCustomerToAccountServlet")
public class JoinCustomerToAccountServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
}
}
,並形成joinCustomerToAccount.jsp
下WebContent/ActionsPages
-
<%@ 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></title>
</head>
<body>
<form action="JoinCustomerToAccountServlet" method="POST">
Account join to him : <input type="text" name="account" />
<input type="submit" value="join" />
</body>
</html>
後,我填寫提交按鈕的形式,按我得到
type Status report
message /MyBankProject/ActionsPages/JoinCustomerToAccountServlet
description The requested resource (/MyBankProject/ActionsPages/JoinCustomerToAccountServlet) is not available.
它看起來像在他的文件夾下搜索並不搜索servlet。
@WebServlet(「/ JoinCustomerToAccountServlet」)我認爲這將從應用程序的根目錄映射servlet。 – 2012-08-10 10:35:16