mirror of
https://github.com/apache/struts.git
synced 2026-08-31 19:35:40 +00:00
Changes necessary for XWork 2.1:
* New EL abstraction to allow ONGL to be replaced * Got rid of static factories and state, in favor of dep injection * New plugin API points for the EL abstraction XW-566 XW-461 XW-561 git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@577728 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -38,6 +38,7 @@ import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.interceptor.ScopedModelDriven;
|
||||
|
||||
/**
|
||||
@@ -61,13 +62,19 @@ public class Struts1Action extends DefaultActionSupport implements ScopedModelDr
|
||||
private String className;
|
||||
private boolean validate;
|
||||
private String scopeKey;
|
||||
private ObjectFactory objectFactory;
|
||||
|
||||
@Inject
|
||||
public void setObjectFactory(ObjectFactory fac) {
|
||||
this.objectFactory = fac;
|
||||
}
|
||||
|
||||
public String execute() throws Exception {
|
||||
ActionContext ctx = ActionContext.getContext();
|
||||
ActionConfig actionConfig = ctx.getActionInvocation().getProxy().getConfig();
|
||||
Action action = null;
|
||||
try {
|
||||
action = (Action) ObjectFactory.getObjectFactory().buildBean(className, null);
|
||||
action = (Action) objectFactory.buildBean(className, null);
|
||||
} catch (Exception e) {
|
||||
throw new StrutsException("Unable to create the legacy Struts Action", e, actionConfig);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user