在控制器servlet中,我把doget作为
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
RequestDispatcher view = req.getRequestDispatcher("views/insert_item.jsp");
view.forward(req, res);
}
在视图中
insert_item.jsp
我想
post
回到同一个调用servlet,但在insert_item.jsp的html格式中,我希望以编程方式指定操作,例如
<form method="post" action="<%= request.GET_CALLING_SERVLET%>">
我试过了
<form method="post" action="<%= request.getServletPath() %>">
<form method="post" action="<%=request.getRequestURI %>">
但这些只是为风景画铺平了道路
views/insert_item.jsp
是否可以通过编程将调用servlet放入HTML表单的操作中??
还是我又一次尝试一些非正统的方法?