📄 strutsvelocitycontext.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: StrutsVelocityContext.java
package org.apache.struts2.views.velocity;
import com.opensymphony.xwork2.util.ValueStack;
import java.util.Map;
import org.apache.velocity.VelocityContext;
public class StrutsVelocityContext extends VelocityContext
{
private static final long serialVersionUID = 0x75ec29af15e214e3L;
ValueStack stack;
VelocityContext chainedContexts[];
public StrutsVelocityContext(ValueStack stack)
{
this(null, stack);
}
public StrutsVelocityContext(VelocityContext chainedContexts[], ValueStack stack)
{
this.chainedContexts = chainedContexts;
this.stack = stack;
}
public boolean internalContainsKey(Object key)
{
boolean contains = super.internalContainsKey(key);
if (contains)
return true;
if (stack != null)
{
Object o = stack.findValue(key.toString());
if (o != null)
return true;
o = stack.getContext().get(key.toString());
if (o != null)
return true;
}
if (chainedContexts != null)
{
for (int index = 0; index < chainedContexts.length; index++)
if (chainedContexts[index].containsKey(key))
return true;
}
return false;
}
public Object internalGet(String key)
{
if (super.internalContainsKey(key))
return super.internalGet(key);
if (stack != null)
{
Object object = stack.findValue(key);
if (object != null)
return object;
object = stack.getContext().get(key);
if (object != null)
return object;
}
if (chainedContexts != null)
{
for (int index = 0; index < chainedContexts.length; index++)
if (chainedContexts[index].containsKey(key))
return chainedContexts[index].internalGet(key);
}
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -