Re: Cannot load template in Linux using Spring FreeMarkerConfigurationFactory

Peter Kleczka <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <CAA99P1Gh+nk2DH_jE8fwOjcChdkRb8k8LHPwe+vO_HfHe89HbQ@mail.gmail.com>
Jan

Thanks for your response. I checked, I am indeed using the correct case for
the file names.
I am also getting inconsistent results for setting the 'templateLoaderPath'
on Windows.
For instance, if I change the folder name to 'freemarker' or 'ftl' it will
refuse to find my files.
Using '/WEB-INF/freemarker/' was used as an example in the documentation.
Perhaps I will have to go with a servlet to deliver these instead of Spring.

2012/2/22 Ing. Jan Novotný <[email protected]>

> Hi, I am using Freemarker on Ubuntu Linux 11.10 and Tomcat 6 without
> problems. I just set up it as a standard FreemarkerServlet (without
> Spring integration part) and it works ok.
> Are you sure the problem is not caused by case-sensitivity of Linux
> systems? This is the most usual problem I see among my colleagues.
>
> Regards,
> Jan
>
> --------------------------------------------------------------
> Ing. Jan Novotný
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> http://blog.novoj.net
> Myšlenky dne otce Fura
> --------------------------------------------------------------
>
>
>
> 2012/2/22 Peter Kleczka <[email protected]>:
> > Hi
> >
> > 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>
> >
> >     <bean id="templateService" class="com.mypkg.service.TemplateService">
> >        <property name="configurationFactory"
> > ref="freemarkerTemplateConfigFactory" />
> >     </bean>
> >
> >
> ------------------------------------------------------------------------------
> > 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.
> > http://www.accelacomm.com/jaw/sfnl/114/51521223/
> > _______________________________________________
> > FreeMarker-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/freemarker-user
> >
>
>
> ------------------------------------------------------------------------------
> 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.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>

------------------------------------------------------------------------------
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.
http://www.accelacomm.com/jaw/sfnl/114/51521223/

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.