本帖最后由 reyoreyoreyo 于 2012-12-02 08:44:22 编辑 报错信息:
Multiple markers at this line
- The type PrivateRequestWrapper must implement the inherited
abstract method ServletRequest.isAsyncSupported()
- The type PrivateRequestWrapper must implement the inherited
abstract method HttpServletRequest.getPart(String)
- The type PrivateRequestWrapper must implement the inherited
abstract method ServletRequest.getDispatcherType()
- The type PrivateRequestWrapper must implement the inherited
abstract method ServletRequest.getServletContext()
- The type PrivateRequestWrapper must implement the inherited
abstract method HttpServletRequest.authenticate(HttpServletResponse)
- The type PrivateRequestWrapper must implement the inherited
abstract method HttpServletRequest.getParts()
- The type PrivateRequestWrapper must implement the inherited
abstract method HttpServletRequest.logout()
- The type PrivateRequestWrapper must implement the inherited
abstract method ServletRequest.startAsync()
- The type PrivateRequestWrapper must implement the inherited
abstract method HttpServletRequest.login(String, String)
- The type PrivateRequestWrapper must implement the inherited
abstract method ServletRequest.isAsyncStarted()
- The type PrivateRequestWrapper must implement the inherited
abstract method ServletRequest.startAsync(ServletRequest, ServletResponse)
- The type PrivateRequestWrapper must implement the inherited
abstract method ServletRequest.getAsyncContext()
代码如下:
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;
/**
* 私有请求包装器,但不继承于 {@link HttpServletRequestWrapper}
*
*
*/
public class PrivateRequestWrapper implements HttpServletRequest {
private HttpServletRequest request;
private Object mutex;
public PrivateRequestWrapper(HttpServletRequest request) {
this.request = request;
this.mutex = request;
}
protected HttpServletRequest getRequest() {
return request;
}
@Override
public RequestDispatcher getRequestDispatcher(String path) {
return getRequest().getRequestDispatcher(path);