Response, request and operation of data in Java

1. Request response

  • Request (HttpServletRequest) : Get request data.
  • Response (HttpServletResponse) : Set the response data.
  • BS architecture: Browser/Server , browser/server architecture mode. The client only needs a browser, and the logic and data of the application are stored on the server.
  • CS architecture: Client/Server , client/server architecture mode.

2. Request

1. postman tool

  • Postman is a powerful Chrome plugin for debugging web pages and sending HTTP requests for web pages.
  • Function: Commonly used for interface testing

2. Simple parameters

  • 1. Original way: In the original web program, to obtain request parameters, you need to manually obtain them through the HttpServletRequest object.
 @RequestMapping("/simpleParam")
    public String simpleParam(HttpServletRequest request) {
        string name = request.getParameter("name");
        string ageStr = request.getParameter("age");
        int age = Integer.parselnt(agestr);
        System.out.println(name + " : " + age);

Guess you like

Origin blog.csdn.net/m0_63144319/article/details/130654312