action tag and sitemesh issue
-----------------------------
Key: WW-2662
URL: https://issues.apache.org/struts/browse/WW-2662
Project: Struts 2
Issue Type: Bug
Components: Core Actions
Affects Versions: 2.1.2
Environment: Mac OS X 10.5.2
Reporter: James Humphrey
When using the action taglib in a jsp decorated by sitemesh, the results of the
action are not embedding correctly.
**example.jsp**
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Example</title>
</head>
<body>
<p>Content Before action result</p>
<s:action namespace="/foo" name="bar" executeResult="true"/> <!-- defining
'flush="true"' also does not work -->
<p>Content after action result</p>
</body>
</html>
*Bar action*
package action.foo;
/**
* Example action.
*/
public class Bar extends ActionSupport {
@Override
public String execute() throws Exception {
// stub for example purposes
}
}
**bar.jsp result**
<p>foobar</p>
**decorators.xml**
<decorators defaultdir="/WEB-INF/decorators">
<!--
main decorator
-->
<decorator name="main" page="main.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>
**main.jsp decorator***
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib prefix="sm" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
<sm:title/>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<sm:head/>
</head>
<body>
<sm:body/>
</body>
</html>
Expected output:
...
<body>
<p>Content Before action result</p>
<p>foobar</p>
<p>Content after action result</p>
</body>
...
Actual output:
<p>foobar</p>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.