2.0.11
------

                 Key: WW-2418
                 URL: https://issues.apache.org/struts/browse/WW-2418
             Project: Struts 2
          Issue Type: Bug
          Components: Core Actions
    Affects Versions: 2.0.11
         Environment: wintel 
struts 2.0.11
jdk 1.50
tc 5.5.17
            Reporter: Martin Gainty


2.0.11
./WEB-INF/decorators/main.jsp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<%
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);

    // Calculate the view sources url
    String sourceUrl = request.getContextPath()+"/viewSource.action";
    com.opensymphony.xwork2.ActionInvocation inv = 
com.opensymphony.xwork2.ActionContext.getContext().getActionInvocation();
    org.apache.struts2.dispatcher.mapper.ActionMapping mapping = 
org.apache.struts2.ServletActionContext.getActionMapping();
    if (inv != null) {
        com.opensymphony.xwork2.util.location.Location loc = 
inv.getProxy().getConfig().getLocation();
        sourceUrl += "?config="+(loc != null ? 
loc.getURI()+":"+loc.getLineNumber() : "");
        sourceUrl += "&className="+inv.getProxy().getConfig().getClassName();

        if (inv.getResult() != null && inv.getResult() instanceof 
org.apache.struts2.dispatcher.StrutsResultSupport) {
          sourceUrl += 
"&page="+mapping.getNamespace()+"/"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult()).getLastFinalLocation();
        }
    }
inv which is an ActionInvocation
xwork 2.0.4 has a getResult returning a Result
  Result getResult() throws Exception;
"+((org.apache.struts2.dispatcher.StrutsResultSupport)inv.getResult

lets take a look at StrutsResultSupport
public abstract class StrutsResultSupport implements Result, StrutsStatics {

i think we have a bizarro world inheritance problem where getResult should 
return 
<some concrete implementation of>StrutsResultSupport and NOT Result

this cast looks very funky

Please have a look

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to