zoukankan      html  css  js  c++  java
  • hello2 source analysis

    String username = request.getParameter("username");//将get~这个方法赋给username这个对象

    if (username != null && username.length()> 0) {//判断值是否为空并且长度大于0

    RequestDispatcher dispatcher =getServletContext().getRequestDispatcher("/response");//定义接收来自客户端的请求并将它们发送到服务器上的任何资源的对象dispatcher,该对象被用作包装位于特定路径上的服务器资源或通过特定名称给定的服务器资源的包装器。

    if (dispatcher != null) {
      dispatcher.include(request, response);
           }
           }
     out.println("</body></html>");//判dispatcher这个对象的值是否为空,并返回输出
      }
      }

      @Override// 伪代码,表示重写
      public String getServletInfo() {
      return "The Hello servlet says hello.";//返回hello最后的输出

      }
      }

  • 相关阅读:
    FTP Protocol
    File Operations
    Ubuntu Install Chinese Input Method
    Vim Intro
    ISA Introduction
    Fourier Transform
    Process/Thread Synchronization
    Process Synchronization-Example 2
    leetcode 栈和队列类型题
    leetcode 字符串类型题
  • 原文地址:https://www.cnblogs.com/zhixiazhimeng/p/10707604.html
Copyright © 2011-2022 走看看