private void initTemplate() {
		Object tplEngine = config.get(Config.KEY_TEMPLATE);
		engineName = null;
		try {
			engineName = (String) tplEngine;
		} catch (ClassCastException e) {
			e.printStackTrace();
		}

		Class<? extends Template> clazz = TemplateEngineSetting
				.getTemplateClassByName(engineName);
		try {
			Constructor<? extends Template> constructor = clazz
					.getConstructor();
			template = constructor.newInstance();
			template.init(Application.WD_TPL_DIR);
		} catch (Exception e) {
			template = null;
			e.printStackTrace();
		}
	}