You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Martin Gainty (JIRA)" <ji...@apache.org> on 2008/01/14 03:48:05 UTC
[jira] Created: (WW-2418) 2.0.11
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.
[jira] Resolved: (WW-2418) 2.0.11
Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ted Husted resolved WW-2418.
----------------------------
Resolution: Incomplete
Fix Version/s: 2.1.1
I would tend to agree with David. If the discussion shows that we should make a change, feel free to reopen.
> 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
> Fix For: 2.1.1
>
>
> 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.
[jira] Commented: (WW-2418) 2.0.11
Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
[ 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.