1 12 package org.openbravo.base.secureApp; 13 14 import org.openbravo.base.*; 16 17 import java.io.*; 18 import javax.servlet.*; 19 import javax.servlet.http.*; 20 21 22 23 public class ServletGoBack extends HttpBaseServlet { 24 String strServletPorDefecto; 25 26 public class Variables extends VariablesHistory { 27 28 public Variables(HttpServletRequest request) { 29 super(request); 30 String sufix = getCurrentHistoryIndex(); 31 removeSessionValue("reqHistory.servlet" + sufix); 32 removeSessionValue("reqHistory.path" + sufix); 33 removeSessionValue("reqHistory.command" + sufix); 34 downCurrentHistoryIndex(); 35 } 36 } 37 38 public void init (ServletConfig config) { 39 super.init(config); 40 strServletPorDefecto = config.getServletContext().getInitParameter("DefaultServlet"); 41 } 42 43 public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException { 44 log4j.info("start doPost"); 45 Variables vars = new Variables(req); 46 String strUrl = strDireccion + vars.getCurrentServletPath(strServletPorDefecto) + "?Command=" + vars.getCurrentServletCommand(); 47 res.sendRedirect(res.encodeRedirectURL(strUrl)); 48 } 49 50 public String getServletInfo() { 51 return "Servlet that receives and redirects go back requests, using history information registered in the httpSession"; 52 } } 54 | Popular Tags |