title: How in the spring of custom import ftl, as spring.ftl
body: <p>My package <code>com.caobug.client.support.view</code> have paging macro <code>pagination.ftl</code> and <code>FreeMarkerConfigurer.java</code></p>
  
  <p><strong>FreeMarkerConfigurer.java:</strong></p>
  
  <pre><code>public class FreeMarkerConfigurer extends org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer {
      @Override
      protected void postProcessTemplateLoaders(List&lt;TemplateLoader&gt; templateLoaders) {
          super.postProcessTemplateLoaders(templateLoaders);
          templateLoaders.add(new ClassTemplateLoader(FreeMarkerConfigurer.class, ""));
      }
  }
  </code></pre>
  
  <p>spring-views.xml:</p>
  
  <pre><code>&lt;bean id="freeMarkerConfigurer" class="com.caobug.client.support.view.FreeMarkerConfigurer"&gt;
      &lt;property name="defaultEncoding" value="utf-8"/&gt;
      &lt;property name="templateLoaderPath" value="/WEB-INF/"/&gt;
      &lt;property name="freemarkerSettings"&gt;
          &lt;props&gt;
              &lt;prop key="template_update_delay"&gt;10&lt;/prop&gt;
              &lt;prop key="locale"&gt;zh_CN&lt;/prop&gt;
              &lt;prop key="number_format"&gt;0.####&lt;/prop&gt;
              &lt;prop key="datetime_format"&gt;yyyy-MM-dd HH:mm:ss&lt;/prop&gt;
              &lt;prop key="classic_compatible"&gt;true&lt;/prop&gt;
              &lt;prop key="template_exception_handler"&gt;ignore&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
      &lt;property name="freemarkerVariables"&gt;
          &lt;map&gt;
              &lt;entry key="shiro"&gt;
                  &lt;bean class="com.caobug.tags.account.ShiroTags"/&gt;
              &lt;/entry&gt;
              &lt;entry key="messageTotal"&gt;
                  &lt;bean class="com.caobug.tags.account.MessageCountTag"/&gt;
              &lt;/entry&gt;
          &lt;/map&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>demo.ftl:</p>
  
  <pre><code>&lt;#import "/pagination.ftl" as pagination /&gt;
  </code></pre>
  
  <h2>Get the following error:</h2>
  
  <pre><code>==&gt; #import "/pagination.ftl" as pagination  [in template "demo.ftl" at line 1, column 1]
  ----------
  </code></pre>
  
  <p>What can I do?</p>