You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ja...@spamgourmet.com on 2010/08/26 18:36:36 UTC

FM template fall-back / multiple template loaders

Is there a way to specify an alternate location for a result template in cases when the template is not found?  If the specified template is missing, I'd like the framework to try looking in a different location before giving me a 500 error. 

I'm already using OGNL in my result configuration, but in this case the getLocation() method is unable to determine for itself whether "login.ftl" exists, since the string "login.ftl" does not appear to be accessible from the ActionContext.   I don't know how to make the action aware of the fact that the result will be "login.ftl" such that getLocation() is able to call File.exists().

<result name="success" type="freemarker">/${location}/login.ftl</result>

Is there perhaps a better way to handle this type of situation?
Would you recommend that I extend the FreemarkerManager class and add my own TemplateLoader into the MultiTemplateLoader list?

Sincerely,
-rgm

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org