java添加templates模板,httpServlet模板改写

为了提高开发效率,通常将一些常用模板添加到快捷键,方法:

window-prefrerences-java-editor-templates

代码复制进去apply应用即可

package com.littlepage.server;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class QuickStartServlet2 extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.getWriter().write("");
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        doGet(request, response);
    }

}

 

posted @ 2018-09-05 23:15  SteveYu  阅读(942)  评论(0编辑  收藏  举报