nameapp.java

来自「java servlet编程源码」· Java 代码 · 共 28 行

JAVA
28
字号
import com.go.teaservlet.*;
import javax.servlet.*;

public class NameApp implements Application {

  // Both init(ApplicationConfig) and destroy() must be implemented because
  // they are declared in the Application interface.  They can be left empty.
  public void init(ApplicationConfig config) throws ServletException {
  }

  // Creating a context provides functions accesible from the templates.
  public Object createContext(ApplicationRequest request,
                              ApplicationResponse response) {
    // You often pass on the request and response even if
    // they are not used, since they may be used later
    return new NameContext(request, response);
  }

  // This method must be implemented to return the class of the object
  // returned by createContext()
  public Class getContextType() {
    return NameContext.class;
  }

  public void destroy() {
  }
}

⌨️ 快捷键说明

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