[ 
https://issues.apache.org/jira/browse/WW-3377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart updated WW-3377:
------------------------------

    Fix Version/s: 3.x
    
> template location is not properly resolved when using action-tag
> ----------------------------------------------------------------
>
>                 Key: WW-3377
>                 URL: https://issues.apache.org/jira/browse/WW-3377
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.8
>            Reporter: Philipp Leusmann
>             Fix For: 3.x
>
>
> if an action-tag with executeResults=true includes an action from a different 
> namespace and the template location of the included action in struts.xml is 
> expressed relative to the namespace, template-loading for the included action 
> fails. The template of the included action is searched for in the directory 
> belonging to the namespace of the including action.
> Example:
> struts.xml:
> <package name="p1" extends="struts-default" namespace="/ns1">
>       <action name="includingAction">
>               <result type="freemarker" name="success">includer.ftl</result>
>       </action>
> </package>
> <package name="p2" extends="struts-default" namespace="/ns2">
>       <action name="includedAction">
>               <result type="freemarker" name="success">included.ftl</result>
>       </action>
> </package>
> and in includer.ftl:
> <@s.action name=includedAction" namespace="ns2" executeResults=true />
> Will result in an Exception:
> ERROR ActionComponent:27 - Could not execute action: /ns1/includingAction
> java.io.FileNotFoundException: Template /ns1/included.ftl not found.
>       at freemarker.template.Configuration.getTemplate(Configuration.java:489)
>       at freemarker.template.Configuration.getTemplate(Configuration.java:459)
>       at 
> org.apache.struts2.views.freemarker.FreemarkerResult.doExecute(FreemarkerResult.java:168)
> [...]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to