You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2014/11/21 09:46:34 UTC

[jira] [Updated] (WW-4422) Component inside Component - "Could not render JSP template"

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

Lukasz Lenart updated WW-4422:
------------------------------
    Description: 
Trying to render a Component inside a Component will fail with logged error "JspTemplateEngine.error(34) | Could not render JSP template". There is a workaround, which is simply to have ANY struts tag after the inner component declared in the <param> of the outer component. Also, the inner component only causes this failure when it has struts tags inside it.

eg. This fails:
{code:xml}
<s:component ... template="someTemplate.jsp">
  <s:param name="body">
    <s:component ... template="otherTemplate.jsp"><!-- only fails if there is struts tag(s) inside otherTemplate.jsp -->
      <!--other params-->
    </s:component>
  </s:param>
<s:component>
{code}
Note that param body is rendered inside someTemplate.jsp like this:
{code:xml}
<s:property value="%{parameters.body}" escapeHtml="false" />
{code}

eg. This will work exactly as expected:
{code:xml}
<s:component ... template="someTemplate.jsp">
  <s:param name="body">
    <s:component ... template="otherTemplate.jsp"><!-- only fails if there is struts tag(s) inside this template -->
      <!--other params-->
    </s:component>
    <s:if test=""><!-- DO NOT DELETE THIS LINE - Fixes "component inside component" bug in Struts 2.3.16.3 --></s:if>
  </s:param>
<s:component>
{code}
Note that the "if" tag can be any struts tag and it will work.

  was:
Trying to render a Component inside a Component will fail with logged error "JspTemplateEngine.error(34) | Could not render JSP template". There is a workaround, which is simply to have ANY struts tag after the inner component declared in the <param> of the outer component. Also, the inner component only causes this failure when it has struts tags inside it.

eg. This fails:

<s:component ... template="someTemplate.jsp">
  <s:param name="body">
    <s:component ... template="otherTemplate.jsp"><!-- only fails if there is struts tag(s) inside otherTemplate.jsp -->
      <!--other params-->
    </s:component>
  </s:param>
<s:component>

Note that param body is rendered inside someTemplate.jsp like this:
<s:property value="%{parameters.body}" escapeHtml="false" />

eg. This will work exactly as expected:

<s:component ... template="someTemplate.jsp">
  <s:param name="body">
    <s:component ... template="otherTemplate.jsp"><!-- only fails if there is struts tag(s) inside this template -->
      <!--other params-->
    </s:component>
    <s:if test=""><!-- DO NOT DELETE THIS LINE - Fixes "component inside component" bug in Struts 2.3.16.3 --></s:if>
  </s:param>
<s:component>

Note that the "if" tag can be any struts tag and it will work.


> Component inside Component - "Could not render JSP template"
> ------------------------------------------------------------
>
>                 Key: WW-4422
>                 URL: https://issues.apache.org/jira/browse/WW-4422
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.3.16.3
>         Environment: Windows, Pluto Portlets
>            Reporter: Mark Goertzen
>              Labels: component
>
> Trying to render a Component inside a Component will fail with logged error "JspTemplateEngine.error(34) | Could not render JSP template". There is a workaround, which is simply to have ANY struts tag after the inner component declared in the <param> of the outer component. Also, the inner component only causes this failure when it has struts tags inside it.
> eg. This fails:
> {code:xml}
> <s:component ... template="someTemplate.jsp">
>   <s:param name="body">
>     <s:component ... template="otherTemplate.jsp"><!-- only fails if there is struts tag(s) inside otherTemplate.jsp -->
>       <!--other params-->
>     </s:component>
>   </s:param>
> <s:component>
> {code}
> Note that param body is rendered inside someTemplate.jsp like this:
> {code:xml}
> <s:property value="%{parameters.body}" escapeHtml="false" />
> {code}
> eg. This will work exactly as expected:
> {code:xml}
> <s:component ... template="someTemplate.jsp">
>   <s:param name="body">
>     <s:component ... template="otherTemplate.jsp"><!-- only fails if there is struts tag(s) inside this template -->
>       <!--other params-->
>     </s:component>
>     <s:if test=""><!-- DO NOT DELETE THIS LINE - Fixes "component inside component" bug in Struts 2.3.16.3 --></s:if>
>   </s:param>
> <s:component>
> {code}
> Note that the "if" tag can be any struts tag and it will work.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)