📄 actioncontextcleanup.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: ActionContextCleanUp.java
package org.apache.struts2.dispatcher;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.profiling.UtilTimerStack;
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
// Referenced classes of package org.apache.struts2.dispatcher:
// Dispatcher
public class ActionContextCleanUp
implements Filter
{
private static final Log LOG = LogFactory.getLog(org/apache/struts2/dispatcher/ActionContextCleanUp);
private static final String COUNTER = "__cleanup_recursion_counter";
public ActionContextCleanUp()
{
}
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException
{
HttpServletRequest request;
HttpServletResponse response;
String timerKey;
request = (HttpServletRequest)req;
response = (HttpServletResponse)res;
timerKey = "ActionContextCleanUp_doFilter: ";
UtilTimerStack.push(timerKey);
Integer count = (Integer)request.getAttribute("__cleanup_recursion_counter");
if (count == null)
count = new Integer(1);
else
count = new Integer(count.intValue() + 1);
request.setAttribute("__cleanup_recursion_counter", count);
chain.doFilter(request, response);
int counterVal = ((Integer)request.getAttribute("__cleanup_recursion_counter")).intValue();
counterVal--;
request.setAttribute("__cleanup_recursion_counter", new Integer(counterVal));
cleanUp(request);
break MISSING_BLOCK_LABEL_184;
Exception exception;
exception;
int counterVal = ((Integer)request.getAttribute("__cleanup_recursion_counter")).intValue();
counterVal--;
request.setAttribute("__cleanup_recursion_counter", new Integer(counterVal));
cleanUp(request);
throw exception;
UtilTimerStack.pop(timerKey);
break MISSING_BLOCK_LABEL_202;
Exception exception1;
exception1;
UtilTimerStack.pop(timerKey);
throw exception1;
}
protected static void cleanUp(ServletRequest req)
{
Integer count = (Integer)req.getAttribute("__cleanup_recursion_counter");
if (count != null && count.intValue() > 0)
{
if (LOG.isDebugEnabled())
LOG.debug((new StringBuilder()).append("skipping cleanup counter=").append(count).toString());
return;
} else
{
ActionContext.setContext(null);
Dispatcher.setInstance(null);
return;
}
}
public void destroy()
{
}
public void init(FilterConfig filterconfig)
throws ServletException
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -