public void render() {
Writer writer = null;
OutputStream os = null;
try {
response.setContentType(contentType);
Template template = gt.getFileTemplate(view);
Enumeration<String> attrs = request.getAttributeNames();
while (attrs.hasMoreElements()) {
String attrName = attrs.nextElement();
template.set(attrName, request.getAttribute(attrName));
}
WebVariable webVariable = new WebVariable();
webVariable.setRequest(request);
webVariable.setResponse(response);
webVariable.setSession(request.getSession());
template.set("servlet", webVariable);
template.set("request", request);
template.set("ctxPath", request.getContextPath());
if (gt.isDirectByteOutput()) {
os = response.getOutputStream();
template.getText(os);
} else {
writer = response.getWriter();
template.getText(writer);
}
} catch (Exception e) {
throw new RenderException(e);
} finally {