📄 mockservletcontext.java
字号:
/**
* Copyright (c) 2005, Paul Tuckey
* All rights reserved.
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
package org.tuckey.web;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Set;
/**
* @author Paul Tuckey
* @version $Revision: 1.3 $ $Date: 2005/12/07 10:22:18 $
*/
public class MockServletContext implements ServletContext {
public ServletContext getContext(String s) {
return null;
}
public int getMajorVersion() {
return 0;
}
public int getMinorVersion() {
return 0;
}
public String getMimeType(String s) {
return null;
}
public Set getResourcePaths(String s) {
return null;
}
public URL getResource(String s) throws MalformedURLException {
return null;
}
public InputStream getResourceAsStream(String s) {
return null;
}
public RequestDispatcher getRequestDispatcher(String s) {
return null;
}
public RequestDispatcher getNamedDispatcher(String s) {
return null;
}
public Servlet getServlet(String s) throws ServletException {
return null;
}
public Enumeration getServlets() {
return null;
}
public Enumeration getServletNames() {
return null;
}
public void log(String s) {
}
public void log(Exception e, String s) {
}
public void log(String s, Throwable throwable) {
}
public String getRealPath(String s) {
return null;
}
public String getServerInfo() {
return null;
}
public String getInitParameter(String s) {
return null;
}
public Enumeration getInitParameterNames() {
return null;
}
public Object getAttribute(String s) {
return null;
}
public Enumeration getAttributeNames() {
return null;
}
public void setAttribute(String s, Object o) {
}
public void removeAttribute(String s) {
}
public String getServletContextName() {
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -