code: @Override
      public boolean configure(final FeatureContext context) {
          final Configuration config = context.getConfiguration();
          if (!config.isRegistered(NotFoundForward.class)) {
              context.register(NotFoundForward.class);
          }
          if (!config.isRegistered(DataViewMessageBodyWriter.class)) {
              context.register(ErrorTemplateExceptionMapper.class);
              context.register(DataViewMessageBodyWriter.class, 1000);
              context.register(new MvcBinder());
  
              Map<String, String> tempConf = Maps.newHashMap();
  
              for (String key : config.getPropertyNames()) {
                  if (key.startsWith(TemplateHelper.TPL_ENGINE_DIR_PR)) {//模板引擎默认路径
                      String engine = key.replaceFirst(Pattern.quote(
                              TemplateHelper.TPL_ENGINE_DIR_PR.substring(0, TemplateHelper.TPL_ENGINE_DIR_PR.length() - 1)
                      ), "");
                      String confKey = TEMPLATE_BASE_PATH + engine;
                      append(config, engine, tempConf, key, confKey, context);
                  } else if (key.startsWith(TPL_MODULE_DIR_PR)) {//模块自定义模板路径
                      String confKey = key.replaceFirst(Pattern.quote(TPL_MODULE_DIR_PR), "");
                      int i = confKey.indexOf(".");
                      if (i != -1) {
                          String engine = confKey.substring(0, i);
                          confKey = TEMPLATE_BASE_PATH + "." + engine;
                          append(config, engine, tempConf, key, confKey, context);
                      }
                  } else if (key.startsWith(TPL_CACHE + ".")) {
                      tempConf.put(CACHE_TEMPLATES + key.replaceFirst(Pattern.quote(TPL_CACHE), ""),
                              (String) config.getProperty(key));
                  }
              }
  
              for (String key : tempConf.keySet()) {
                  context.property(key, tempConf.get(key));
              }
  
              context.property(TEMPLATE_BASE_PATH,
                      config.getProperty(TemplateHelper.TPL_DIR));
  
              context.property(CACHE_TEMPLATES,
                      config.getProperty(TPL_CACHE));
          }
  
          return true;
      }
docs: {@inheritDoc}