Example usage for org.apache.commons.chain.web.servlet ServletWebContext put

List of usage examples for org.apache.commons.chain.web.servlet ServletWebContext put

Introduction

In this page you can find the example usage for org.apache.commons.chain.web.servlet ServletWebContext put.

Prototype

public Object put(Object key, Object value) 

Source Link

Document

Override the default Map behavior to set the value of a local property if the specified key matches a local property name.

Usage

From source file:org.apache.struts.chain.legacy.ComposableRequestProcessor.java

/**
 * <p>Process an <code>HttpServletRequest</code> and create the
 * corresponding <code>HttpServletResponse</code>.</p>
 *
 * @param request The servlet request we are processing
 * @param response The servlet response we are creating
 *
 * @exception IOException if an input/output error occurs
 * @exception ServletException if a processing exception occurs
 *//*from   w  ww.ja  v a 2 s .  c o m*/
public void process(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException {

    // Wrap the request in the case of a multipart request
    request = processMultipart(request);

    // Create and populate a Context for this request
    ServletWebContext context = new ServletWebContext();
    context.initialize(getServletContext(), request, response);
    context.put(Constants.ACTION_SERVLET_KEY, this.servlet);
    context.put(Constants.MODULE_CONFIG_KEY, this.moduleConfig);

    // Create and execute the command.
    try {
        if (log.isDebugEnabled()) {
            log.debug("Using processing chain for this request");
        }
        command.execute(context);
    } catch (Exception e) {
        // Execute the exception processing chain??
        throw new ServletException(e);
    }

    // Release the context.
    context.release();
}