Java Mailing List Archive

Home » FreeMarker-user »

[FreeMarker-user] Cannot load template in Linux using Spring

Peter Kleczka


Replies: Find Java Web Hosting

Author LoginPost Reply

I have a web app on Tomcat 6 that loads FreeMarker templates via org.springframework.ui.freemarker.FreeMarkerConfigurationFactory. The web app is plain JSP (not Spring MVC). The app works fine in a Windows environment, but will not work on Linux (Slackware 13.37 64 bit). When I run it on Linux it gives me a file not found exception. I have tried multiple variations on this configuration including putting my templates directory in the classpath, using Spring prefixes like "file:" and "classpath:" for the templateLoaderPath.  Nothing has worked.  Please let me know if you have any ideas to fix. Thanks, Peter.

    <!-- Freemarker template config factory. Works on Windows -->
    <bean id="freemarkerTemplateConfigFactory" class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactory">
        <property name="templateLoaderPath" value="/WEB-INF/ftemplates/" />

    <bean id="templateService" class="com.mypkg.service.TemplateService">
       <property name="configurationFactory" ref="freemarkerTemplateConfigFactory" />
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
FreeMarker-user mailing list
©2008 - Jax Systems, LLC, U.S.A.