You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Philipp Leusmann (JIRA)" <ji...@apache.org> on 2010/01/22 13:23:24 UTC

[jira] Created: (WW-3377) template location is not properly resolved when using action-tag

template location is not properly resolved when using action-tag
----------------------------------------------------------------

                 Key: WW-3377
                 URL: https://issues.apache.org/struts/browse/WW-3377
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.1.8
            Reporter: Philipp Leusmann


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.
-
You can reply to this email to add a comment to the issue online.