⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basicservlet.java

📁 java的一系列产品中包括jsme,jmse,j2ee,本文件提供j2ee实现的源代码.
💻 JAVA
字号:
/**
 * this servlet is the super servlet,to offer common methods to the sub_servlets
 * all the sub_servlets need to implement the abstract method:doExecute().
**/

public abstract class BasicServlet extends HttpServlet
{
  private static final String CONTENT_TYPE = "text/html; charset=Shift_JIS";

  public void init(ServletConfig config) throws ServletException{
    super.init(config);
    ......//do other initialize
  }

  public void doGet(HttpServletRequest req,HttpServletResponse res)
  	throws ServletException, IOException{
    doExecute(request,response);
  }

  public void doPost(HttpServletRequest req, HttpServletResponse res) 
  	throws ServletException, IOException{
    doExecute(request,response);
  }

  public String getContentType(){
    return CONTENT_TYPE;
  }

/**
 * Public abstract Method:need be implement by subclass
**/
  public abstract void doExecute(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException;
}

⌨️ 快捷键说明

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