作用自定义的servlet开发模板,提升开发效率

一、示例

作用自定义的servlet开发模板,提升开发效率_第1张图片

在使用组件方式新建的servlet中,按ctrl+a全选然后输入serv然后alt+/自动补全

二、servlet模板

package ${enclosing_package};
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 ${primary_type_name} extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

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

 

你可能感兴趣的:(Java,网络编程)