1 20 21 import org.apache.struts.action.Action; 22 import org.apache.struts.action.ActionMapping; 23 import org.apache.struts.action.ActionForm; 24 import org.apache.struts.action.ActionForward; 25 26 import javax.servlet.http.HttpServletRequest ; 27 import javax.servlet.http.HttpServletResponse ; 28 29 import com.methodhead.shim.*; 30 31 public class UtilAction 32 extends 33 Action { 34 35 37 39 41 43 public ActionForward execute( 44 ActionMapping mapping, 45 ActionForm form, 46 HttpServletRequest request, 47 HttpServletResponse response ) 48 throws 49 Exception { 50 51 if ( "clearSiteMaps".equals( request.getParameter( "action" ) ) ) { 52 getServlet().getServletContext().removeAttribute( ShimGlobals.SITEMAPMAP_KEY ); 53 } 54 else { 55 throw new RuntimeException ( "Unexpected action \"" + request.getParameter( "action" ) + "\"" ); 56 } 57 58 return null; 59 } 60 61 63 } 65 | Popular Tags |