strutsrequestwrapper.java

来自「struts 2 核心包 的源码 有错误是难免的」· Java 代码 · 共 48 行

JAVA
48
字号
// 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:   StrutsRequestWrapper.java

package org.apache.struts2.dispatcher;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.ValueStack;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;

public class StrutsRequestWrapper extends HttpServletRequestWrapper
{

	public StrutsRequestWrapper(HttpServletRequest req)
	{
		super(req);
	}

	public Object getAttribute(String s)
	{
		ActionContext ctx;
		Object attribute;
		if (s != null && s.startsWith("javax.servlet"))
			return super.getAttribute(s);
		ctx = ActionContext.getContext();
		attribute = super.getAttribute(s);
		boolean alreadyIn = false;
		Boolean b = (Boolean)ctx.get("__requestWrapper.getAttribute");
		if (b != null)
			alreadyIn = b.booleanValue();
		if (alreadyIn || attribute != null || s.indexOf("#") != -1)
			break MISSING_BLOCK_LABEL_129;
		ctx.put("__requestWrapper.getAttribute", Boolean.TRUE);
		ValueStack stack = ctx.getValueStack();
		if (stack != null)
			attribute = stack.findValue(s);
		ctx.put("__requestWrapper.getAttribute", Boolean.FALSE);
		break MISSING_BLOCK_LABEL_129;
		Exception exception;
		exception;
		ctx.put("__requestWrapper.getAttribute", Boolean.FALSE);
		throw exception;
		return attribute;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?