/** * Implementation of the <tt>execute</tt> method from the <tt>Result</tt> interface. This will call * the abstract method {@link #doExecute(String, ActionInvocation)} after optionally evaluating the * location as an OGNL evaluation. * * @param invocation the execution state of the action. * @throws Exception if an error occurs while executing the result. */ public void execute(ActionInvocation invocation) throws Exception { doExecute(conditionalParse(location, invocation), invocation); }
/** * This method is required by Weblogic 6.1 SP4 because * they defined this as a required method just before * the Servlet 2.3 specification was finalized. * * @return the filter's filter configuration */ public FilterConfig getFilterConfig() { return super.getFilterConfig(); } }
public static void initialize(ServletContext servletContext) { synchronized (DispatcherUtils.class) { if (instance == null) { instance = new DispatcherUtils(servletContext); } } }
public Map createContextMap(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping, ServletContext context) { // request map wrapping the http request objects Map requestMap = new RequestMap(request); // parameters map wrapping the http paraneters. Map params = null; if (mapping != null) { params = mapping.getParams(); } Map requestParams = new HashMap(request.getParameterMap()); if (params != null) { params.putAll(requestParams); } else { params = requestParams; } // session map wrapping the http session Map session = new SessionMap(request); // application map wrapping the ServletContext Map application = new ApplicationMap(context); return createContextMap(requestMap, params, session, application, request, response, context); }
/** * Wraps and returns the given response or returns the original response object. This is used to transparently * handle multipart data as a wrapped class around the given request. Override this method to handle multipart * requests in a special way or to handle other types of requests. Note, {@link com.opensymphony.webwork.dispatcher.multipart.MultiPartRequestWrapper} is * flexible - you should look to that first before overriding this method to handle multipart data. * * @param request the HttpServletRequest object. * @return a wrapped request or original request. * @see com.opensymphony.webwork.dispatcher.multipart.MultiPartRequestWrapper */ public HttpServletRequest wrapRequest(HttpServletRequest request, ServletContext servletContext) throws IOException { // don't wrap more than once if (request instanceof WebWorkRequestWrapper) { return request; } if (MultiPartRequest.isMultiPart(request)) { request = new MultiPartRequestWrapper(request, getSaveDir(servletContext), getMaxSize()); } else { request = new WebWorkRequestWrapper(request); } return request; }
/** * @param servletContext * @throws ServletException */ private DWRAction(ServletContext servletContext) throws ServletException { DispatcherUtils.initialize(servletContext); wwDispatcher = DispatcherUtils.getInstance(); actionProcessor = loadActionProcessor(servletContext.getInitParameter(DWRACTIONPROCESSOR_INIT_PARAM)); }
public void destroy() { DispatcherUtils du = DispatcherUtils.getInstance(); // should not be null as it is initialized in init(FilterConfig) if (du == null) { LOG.warn("something is seriously wrong, DispatcherUtil is not initialized (null) "); } du.cleanup(); }
/** * Initalizes the servlet. Please read the {@link ServletDispatcher class documentation} for more * detail. <p> * * @param servletConfig the ServletConfig object. * @throws ServletException if an error occurs during initialization. */ public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); DispatcherUtils.initialize(getServletContext()); }
public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; String param = filterConfig.getInitParameter("packages"); String packages = "com.opensymphony.webwork.static template com.opensymphony.webwork.interceptor.debugging"; if (param != null) { packages = param + " " + packages; } this.pathPrefixes = parse(packages); DispatcherUtils.initialize(filterConfig.getServletContext()); }
/** * @see javax.servlet.http.HttpServletRequest#getParameterNames() */ public Enumeration getParameterNames() { if (multi == null) { return super.getParameterNames(); } else { return mergeParams(multi.getParameterNames(), super.getParameterNames()); } }
/** * @see javax.servlet.http.HttpServletRequest#getParameter(String) */ public String getParameter(String name) { return ((multi == null) || (multi.getParameter(name) == null)) ? super.getParameter(name) : multi.getParameter(name); }
/** * @see javax.servlet.http.HttpServletRequest#getParameterValues(String) */ public String[] getParameterValues(String name) { return ((multi == null) || (multi.getParameterValues(name) == null)) ? super.getParameterValues(name) : multi.getParameterValues(name); }
public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; DispatcherUtils.initialize(filterConfig.getServletContext()); }
/** * Saves an attribute in the request. * * @param key the name of the request attribute. * @param value the value to set. * @return the object that was just set. */ public Object put(Object key, Object value) { entries = null; request.setAttribute(key.toString(), value); return get(key); }
/** * Sets a servlet context attribute given a attribute name and value. * * @param key the name of the attribute. * @param value the value to set. * @return the attribute that was just set. */ public Object put(Object key, Object value) { entries = null; context.setAttribute(key.toString(), value); return get(key); }
protected DispatcherUtils(ServletContext servletContext) { init(servletContext); }
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException { ServletRequestContainerLauncher containerLauncher = new ServletRequestContainerLauncher(getServletContext(), request); try { containerLauncher.startContainer(); // process the servlet using webwork2 super.service(request, response); } finally { containerLauncher.killContainer(); } } }
/** * @see javax.portlet.GenericPortlet#destroy() */ public void destroy() { // WW-1395 super.destroy(); DispatcherUtils dispatcherUtils = DispatcherUtils.getInstance(); if (dispatcherUtils == null) { LOG.warn("something is seriously wrong, DispatcherUtil is not initialized (null) "); } else { dispatcherUtils.cleanup(); } }
/** * Removes the specified request attribute. * * @param key the name of the attribute to remove. * @return the value that was removed or <tt>null</tt> if the value was not found (and hence, not removed). */ public Object remove(Object key) { entries = null; Object value = get(key); request.removeAttribute(key.toString()); return value; } }
/** * Removes the specified servlet context attribute. * * @param key the attribute to remove. * @return the entry that was just removed. */ public Object remove(Object key) { entries = null; Object value = get(key); context.removeAttribute(key.toString()); return value; } }