美文网首页
web应用整体串联

web应用整体串联

作者: zcm0210 | 来源:发表于2017-12-11 23:23 被阅读0次

    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应用整体串联

          本文链接:https://www.haomeiwen.com/subject/whzwixtx.html