Attachment 'GzipAction.java'

Download

   1 /** Creado en 13-ene-2004 */
   2 package fcc.ima.cocoon;
   3 
   4 import java.util.Map;
   5 
   6 import org.apache.avalon.framework.parameters.Parameters;
   7 import org.apache.cocoon.acting.AbstractAction;
   8 import org.apache.cocoon.environment.ObjectModelHelper;
   9 import org.apache.cocoon.environment.Redirector;
  10 import org.apache.cocoon.environment.SourceResolver;
  11 
  12 /**Control the Gzip when using the {@link fcc.ima.cocoon.GzipNonCachingProcessingPipeline}.
  13  * <p>The <code>use</code> parameter whose default value is 1, controls the gzip compression.
  14  * @author dperezcar */
  15 public class GzipAction extends AbstractAction {
  16 	/** @see org.apache.cocoon.acting.AbstractAction#act(org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters) */
  17 	public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
  18 	throws Exception {
  19 		ObjectModelHelper.getRequest(objectModel).setAttribute(GzipNonCachingProcessingPipeline.USE_GZIP_KEY, parameters.getParameter("use", "1"));
  20 		return EMPTY_MAP;
  21 	}
  22 }

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.