1 16 package org.apache.cocoon.generation; 17 18 import org.apache.avalon.framework.parameters.Parameters; 19 20 import org.apache.cocoon.ProcessingException; 21 import org.apache.cocoon.environment.Context; 22 import org.apache.cocoon.environment.ObjectModelHelper; 23 import org.apache.cocoon.environment.Request; 24 import org.apache.cocoon.environment.Response; 25 import org.apache.cocoon.environment.SourceResolver; 26 27 import org.xml.sax.SAXException ; 28 29 import java.io.IOException ; 30 import java.util.Map ; 31 32 37 public abstract class ServletGenerator extends ComposerGenerator { 38 39 protected Request request; 40 protected Response response; 41 protected Context context; 42 43 public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) 44 throws ProcessingException, SAXException , IOException { 45 46 super.setup(resolver, objectModel, src, par); 47 this.request = ObjectModelHelper.getRequest(objectModel); 48 this.response = ObjectModelHelper.getResponse(objectModel); 49 this.context = ObjectModelHelper.getContext(objectModel); 50 } 51 52 55 public void recycle() { 56 super.recycle(); 57 this.request = null; 58 this.response = null; 59 this.context = null; 60 } 61 } 62 | Popular Tags |