web应用整体串联

1、新建web_maven工程

建工程

web_project——>suportMaven——>generate web.xml——>standard Maven Project


2、pom.xml中添加servelet依赖

javax.servletjavax.servlet-api3.0.1provided

3、开发http接口(继承HTTPServlet类)

packagecom.guoyasoft;importjava.io.IOException;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;publicclassLoginextendsHttpServlet{@OverrideprotectedvoiddoGet(HttpServletRequest req, HttpServletResponse resp)throwsServletException, IOException{ System.out.println("------------login doGet-----------------");super.doGet(req, resp); }@OverrideprotectedvoiddoPost(HttpServletRequest req, HttpServletResponse resp)throwsServletException, IOException{ System.out.println("-------------login doGet-----------------");super.doPost(req, resp); }}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • web_maven工程 maven项目构建 接口规范 http协议 web服务器(servlet容器) html界...
    果芽软件阅读 731评论 0 5
  • Intelli IDEA是目前比较流行的开发环境,可以配置Maven进行项目管理,非常便捷,受到很多开发者的青睐。...
    heguorui阅读 6,385评论 0 39
  • 新年将至时,妻说:“你在下下周日别出门,给你许了愿,庙里方丈说一整天都不要出门儿,如是可避一年烦扰”。 “好,正想...
    君子包阅读 276评论 0 2
  • 1. 多线程使用的优缺点? 优点: (1)多线程技术使程序的响应速度更快 (2)当前没有进行处理的任务可以将处理器...
    Aimerwhy阅读 256评论 0 0
  • “过来吃饭了,快点!” “我来洗澡了,快点!” “赶紧吃好饭,去上学,快点!” “你书桌这么乱,快收拾一下!” “...
    庄心爱写作阅读 1,382评论 0 1