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

Posted Steve Yu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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);
    }

}

 

以上是关于java添加templates模板,httpServlet模板改写的主要内容,如果未能解决你的问题,请参考以下文章