request..getServletPath(); //獲得該Servlet的訪問相對路徑 /control.action
request.getSession.getServletContext().getRealPath(request.getRequestURI());
// 獲得該Servlet的絕對路徑 F:\workspace\Java\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\ShopCart\ShopCart\control.action
getServletConfig().getServletContext().getRealPath("/");
//獲得該Servlet的相對路徑 F:\workspace\Java\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\ShopCart\