} else {
moduleName = mappingRuleService.getMappedName(CONTROL_MODULE_NO_TEMPLATE, target);
}
// ִ��control module
Module controlModule;
if (templateName == null) {
// templateNameδָ��ʱ��������module����û�����׳�ModuleNotFoundException
controlModule = moduleLoaderService.getModule(CONTROL_MODULE, moduleName);
} else {
// ��ָ����templateNameʱ������û�е�control module����������Ⱦģ�塣
// ������ʵ����page-driven������дģ�壬��Ҫʱ��дһ��module class��֮��Ӧ��
controlModule = moduleLoaderService.getModuleQuiet(CONTROL_MODULE, moduleName);
}
if (log.isTraceEnabled()) {
if (templateName != null) {
log.trace("Rendering control: template=" + templateName + ", control=" + moduleName);
} else {
log.trace("Rendering control without template: control=" + moduleName);
}
}
// ����
this.bufferedRequestContext.pushBuffer();
try {
controlParameterStack.addFirst(new ControlParameters()); // ֧��control��Ƕ��
TurbineRunDataInternal rundata = (TurbineRunDataInternal) TurbineUtil.getTurbineRunData(this.request);
Context contextForControl = createContextForControl(params, componentName);
rundata.pushContext(contextForControl, templateName);
try {
if (controlModule != null) {
controlModule.execute();
}
// Control module����ͨ��ע��ControlParameters�ӿ�����template��
String templateOverriden = rundata.getControlTemplate();