Remote content retrieved 2/3 times
----------------------------------
Key: WW-2738
URL: https://issues.apache.org/struts/browse/WW-2738
Project: Struts 2
Issue Type: Bug
Components: Plugin - Dojo Tags
Environment: Win XP
IE6/FF2/Safari 3.1
Tomcat 6.0.16
JDK 1.5.0_06
Struts 2.0.11 / 2.1.2 (binary)
Reporter: Bill Bruyn
Using Struts 2.0.11, the following markup causes goodbyeWorld's execute method
to be called twice:
<sx:tabbedpanel id="tabContainer" >
<s:url action="goodbyeWorld" id="url"/>
<sx:div label="Tab 1" href="%{#url}">Remote Tab</sx:div>
<sx:div label="Tab 2">Local Tab</sx:div> </sx:tabbedpanel>
When the remote content follows the local content (Tab 1 is placed after Tab
2), it's called just once.
Switch out the libraries and change the tags accordingly to use 2.1.2 syntax,
and I think you'll find that remote content on tab 1 calls the action 3 times.
Remote content on tab 2 is called twice.
I've also noticed that with s:head debug=true, you see a lot of widget id
collisions. Possibly related?
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>hello</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="base-package" namespace="/" extends="struts-default">
<action name="helloWorld" class="hello.HelloWorld">
<result>helloWorld.jsp</result>
</action>
<action name="goodbyeWorld" class="goodbye.GoodbyeWorld">
<result>goodbyeWorld.jsp</result>
</action>
</package>
</struts>
package hello;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {
private String message = "Hello World!";
public String getMessage() {
return message;
}
@Override
public String execute() throws Exception {
System.out.println(message);
return SUCCESS;
}
}
<%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sx"
uri="/struts-dojo-tags" %> <html> <head>
<sx:head debug="true"/>
</head>
<body>
<sx:tabbedpanel id="tabContainer" >
<sx:div label="Local">
<s:property value="message"/>
</sx:div>
<s:url action="goodbyeWorld" id="url"/>
<sx:div label="Remote" href="%{#url}"/>
</sx:tabbedpanel>
</body>
</html>
package goodbye;
import com.opensymphony.xwork2.ActionSupport;
public class GoodbyeWorld extends ActionSupport {
private String message = "Goodbye, World!";
public String getMessage() {
return message;
}
@Override
public String execute() throws Exception {
System.out.println(message);
return super.execute();
}
}
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head/>
<body>
<s:property value="message"/>
</body>
</html>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.