in a controller servlet I have the doGet as
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
RequestDispatcher view = req.getRequestDispatcher("views/insert_item.jsp");
view.forward(req, res);
}
in the view insert_item.jsp
I want to post
back to the same calling servlet but in the HTML Form of the insert_item.jsp I want to specify the Action programmatically such as
<form method="post" action="<%= request.GET_CALLING_SERVLET%>">
I've tried
<form method="post" action="<%= request.getServletPath() %>">
<form method="post" action="<%=request.getRequestURI %>">
but these just put the path to the view views/insert_item.jsp
Is it possible to programmatically put the calling servlet into the action of an HTML Form?? Or am I once again trying some unorthodix approach?