@@ -660,6 +660,42 @@ public void universalGetTemplate(@PathVariable("name") String name, @Context Htt
660660 }
661661 }
662662
663+ @ GetMapping (path = "/{name}.ftl" )
664+ public void universalGetFreemarkerTemplate (@ PathVariable ("name" ) String name , @ Context HttpServletRequest request , @ Context HttpServletResponse response ) {
665+ CfTemplate cftemplate = null ;
666+ try {
667+ cftemplate = cftemplateService .findByName (name );
668+ if (0 == cftemplate .getScriptlanguage ()) {
669+ response .setContentType ("text/html" );
670+ response .setCharacterEncoding ("UTF-8" );
671+ PrintWriter outwriter = response .getWriter ();
672+ outwriter .println (cftemplate .getContent ());
673+ } else {
674+ LOGGER .warn ("ONLY Freemarker Templates" );
675+ }
676+ } catch (Exception ex ) {
677+ LOGGER .warn ("Template NOT FOUND" );
678+ }
679+ }
680+
681+ @ GetMapping (path = "/{name}.vm" )
682+ public void universalGetVelocityTemplate (@ PathVariable ("name" ) String name , @ Context HttpServletRequest request , @ Context HttpServletResponse response ) {
683+ CfTemplate cftemplate = null ;
684+ try {
685+ cftemplate = cftemplateService .findByName (name );
686+ if (1 == cftemplate .getScriptlanguage ()) {
687+ response .setContentType ("text/html" );
688+ response .setCharacterEncoding ("UTF-8" );
689+ PrintWriter outwriter = response .getWriter ();
690+ outwriter .println (cftemplate .getContent ());
691+ } else {
692+ LOGGER .warn ("ONLY Velocity Templates" );
693+ }
694+ } catch (Exception ex ) {
695+ LOGGER .warn ("Template NOT FOUND" );
696+ }
697+ }
698+
663699 @ GetMapping (path = "/{name}.js" )
664700 public void universalGetJS (@ PathVariable ("name" ) String name , @ Context HttpServletRequest request , @ Context HttpServletResponse response ) {
665701 CfJavascript cfjavascript = null ;
0 commit comments