html如何调用Servlet啊.form的action应该怎么写
1个回答
展开全部
<servlet>
<servlet-name>userServlet</servlet-name>
<servlet-class>com.donic.servlet.UserServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>userServlet</servlet-name>
<url-pattern>/user</url-pattern>
</servlet-mapping>
<FORM method=post action="user?action=login">
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
String action = request.getParameter("action");// 获取动作类型
if ("login".equals(action)) {
this.login(request, response);
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询