📄 basicservlet.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 + -