Skip to content

Instantly share code, notes, and snippets.

@A-pZ
Created March 12, 2015 06:32
Show Gist options
  • Save A-pZ/209f9aeee8ad2a213e52 to your computer and use it in GitHub Desktop.
Save A-pZ/209f9aeee8ad2a213e52 to your computer and use it in GitHub Desktop.
Struts2.3.20+SpringAOPにて、Actionクラスで例外を投げるとresultがnullになってしまう問題
// Struts2のDispatcherクラスで次の違いがあった。
// 2.3.20
/* 549*/ UtilTimerStack.push(timerKey);
/* 550*/ String namespace = mapping.getNamespace();
/* 551*/ String name = mapping.getName();
/* 552*/ String method = mapping.getMethod();
/* 554*/ ActionProxy proxy = ((ActionProxyFactory)getContainer().getInstance(com/opensymphony/xwork2/ActionProxyFactory)).createActionProxy(namespace, name, method, extraContext, true, false);
/* 557*/ request.setAttribute("struts.valueStack", proxy.getInvocation().getStack());
// 2.3.16.3
UtilTimerStack.push(timerKey);
String namespace = mapping.getNamespace();
String name = mapping.getName();
String method = mapping.getMethod();
Configuration config = configurationManager.getConfiguration();
ActionProxy proxy = config.getContainer().getInstance(ActionProxyFactory.class).createActionProxy(
namespace, name, method, extraContext, true, false);
request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, proxy.getInvocation().getStack());
@A-pZ
Copy link
Author

A-pZ commented Mar 12, 2015

Struts2.3.22-SNAPSHOTで解決していました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment