Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
2.0.11
-
None
-
wintel
struts 2.0.11
jdk 1.50
tc 5.5.17
Description
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