📄 portletactionredirectresult.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: PortletActionRedirectResult.java
package org.apache.struts2.portlet.result;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import java.util.*;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.views.util.UrlHelper;
// Referenced classes of package org.apache.struts2.portlet.result:
// PortletResult
public class PortletActionRedirectResult extends PortletResult
{
private static final long serialVersionUID = 0x9626122c793b59c3L;
public static final String DEFAULT_PARAM = "actionName";
protected String actionName;
protected String namespace;
protected String method;
private Map requestParameters;
private ActionMapper actionMapper;
protected List prohibitedResultParam;
public PortletActionRedirectResult()
{
requestParameters = new LinkedHashMap();
prohibitedResultParam = Arrays.asList(new String[] {
"actionName", "namespace", "method", "encode", "parse", "location", "prependServletContext"
});
}
public PortletActionRedirectResult(String actionName)
{
this(null, actionName, null);
}
public PortletActionRedirectResult(String actionName, String method)
{
this(null, actionName, method);
}
public PortletActionRedirectResult(String namespace, String actionName, String method)
{
super(null);
requestParameters = new LinkedHashMap();
prohibitedResultParam = Arrays.asList(new String[] {
"actionName", "namespace", "method", "encode", "parse", "location", "prependServletContext"
});
this.namespace = namespace;
this.actionName = actionName;
this.method = method;
}
public void setActionMapper(ActionMapper actionMapper)
{
this.actionMapper = actionMapper;
}
public void execute(ActionInvocation invocation)
throws Exception
{
actionName = conditionalParse(actionName, invocation);
if (namespace == null)
namespace = invocation.getProxy().getNamespace();
else
namespace = conditionalParse(namespace, invocation);
if (method == null)
method = "";
else
method = conditionalParse(method, invocation);
String resultCode = invocation.getResultCode();
if (resultCode != null)
{
ResultConfig resultConfig = (ResultConfig)invocation.getProxy().getConfig().getResults().get(resultCode);
Map resultConfigParams = resultConfig.getParams();
Iterator i = resultConfigParams.entrySet().iterator();
do
{
if (!i.hasNext())
break;
java.util.Map.Entry e = (java.util.Map.Entry)i.next();
if (!prohibitedResultParam.contains(e.getKey()))
requestParameters.put(e.getKey().toString(), e.getValue() != null ? ((Object) (conditionalParse(e.getValue().toString(), invocation))) : "");
} while (true);
}
StringBuffer tmpLocation = new StringBuffer(actionMapper.getUriFromActionMapping(new ActionMapping(actionName, namespace, method, null)));
UrlHelper.buildParametersString(requestParameters, tmpLocation, "&");
setLocation(tmpLocation.toString());
super.execute(invocation);
}
public void setActionName(String actionName)
{
this.actionName = actionName;
}
public void setNamespace(String namespace)
{
this.namespace = namespace;
}
public void setMethod(String method)
{
this.method = method;
}
public PortletActionRedirectResult addParameter(String key, Object value)
{
requestParameters.put(key, String.valueOf(value));
return this;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -