[ 
https://issues.apache.org/struts/browse/WW-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42973#action_42973
 ] 

Dave Newton commented on WW-2418:
---------------------------------

What JSP code is this you're referring to? Part of Struts? What's the bug? The 
above code *does* assume it's returning a StrutsResultSupport before the cast, 
and if we have an instanceof StrutsResultSupport (which is also a Result) I'm 
not sure what the issue is.

This is probably better discussed on struts-user until it's determined there's 
actually a bug.

> 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