In the block refactoring, I've come across Servlet Generator. Whatever the name tells you, it seems to have nothing to do with Servlets. Probably it's due to the includion of the environment abstraction.

Why not simply move these methods in ComposerGenerator and make classes using this use the ComposerGenerator directly?
It would eliminate the confusion and shorten the stacktrace.

Here is the class:

public abstract class ServletGenerator extends ComposerGenerator {

protected Request request=null;
protected Response response=null;
protected Context context=null;

public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
throws ProcessingException, SAXException, IOException {

super.setup(resolver, objectModel, src, par);
this.request = ObjectModelHelper.getRequest(objectModel);
this.response = ObjectModelHelper.getResponse(objectModel);
this.context = ObjectModelHelper.getContext(objectModel);
}

/**
* Recycle the generator by removing references
*/
public void recycle() {
super.recycle();
this.request = null;
this.response = null;
this.context = null;
}
}


--
Nicola Ken Barozzi [EMAIL PROTECTED]
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to