struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vijayakannan (Commented) (JIRA)" <>
Subject [jira] [Commented] (WW-3764) Reading( doesn't include templatePath value from web.xml
Date Sat, 07 Apr 2012 05:07:23 GMT


Vijayakannan commented on WW-3764:

When i try to load the struts default template from application path "/WEB-INF/template" by
setting struts.ui.templateDir in stuts.xml, i am geting this Exception.

SEVERE: Could not open template Template /WEB-INF/template/xhtml/a.ftl not found.
	at freemarker.template.Configuration.getTemplate(
	at freemarker.template.Configuration.getTemplate(
	at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(
	at org.apache.struts2.components.UIBean.mergeTemplate(
	at org.apache.struts2.components.ClosingUIBean.start(
	at org.apache.struts2.components.Anchor.start(
	at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(

> Reading( doesn't include templatePath value
from web.xml
> ---------------------------------------------------------------------------------------------------
>                 Key: WW-3764
>                 URL:
>             Project: Struts 2
>          Issue Type: Temp
>    Affects Versions: 2.3.1
>         Environment: Tomcat v7.0
>            Reporter: Vijayakannan
>              Labels:
>             Fix For: 2.5.x
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> There is an option in Struts2 to load the freemarker template from path by setting in
web.xml (templatePath).Templates are loaded from the file system if we configure the file
> Also there is an option to extend the themes by setting the value for "parent" key in
the within the template folder
> readProperty() method helps us to read the file from the file system
and also from the classpath
> Aruguments :- 
> Combination of template directory ,template and file name ""  are passed
as propName
> This method doesn't help us to load the from the specified templatePath

> private InputStream readProperty(String propName) {
>         InputStream is = tryReadingPropertyFileFromFileSystem(propName);
>         if (is == null) {
>             is = readPropertyFromClasspath(propName);
>         }
>         return is;
>     }

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message