?? 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 + -