0%

笔试

  1. Cookie,Session

    1. Cookie一般保存在浏览器,不安全;Session一般保存在服务器,Session多了服务器压力大
    2. Cookie只能存储String类型数据,Session可以保存任意类型数据
  2. 5常见错误

    1. 命名不规范
    2. 空指针异常未处理
    3. 资源未关闭
  3. 修改代码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    public ArrayList bad_smell_demo(String param) { 
    ArrayList<String> list = new ArrayList<>();
    if ("xxx".equals(param)) {
    list.add(param);
    } else if ("".equals(param)) {
    try {
    for (int i = 0; i < 10; i++) {
    param += "0";
    }
    } catch (Exception e) {
    throw new IllegalStateException("failed");
    }
    }
    return list;
    }
  4. 电脑-浏览器-用户输入百度域名-DNS解析域名获取IP-发送http请求到百度服务器-百度服务器返回百度一下页面-浏览器解析页面并渲染显示页面-用户在输入框输入大米价格并点击百度一下按钮提交表单-百度服务器controller请求对应映射方法进行参数获取并将具体业务交给service处理-service通过类似ElasticSearch的搜索引擎获取大米价格相关结果信息并返回给controller-controller将结果封装成前端页面需要的形式返回-jsp容器使用模版引擎渲染页面显示给用户-用户点击相关页面链接查看具体信息-百度服务器controller接收到要前往的url,重定向到该url-请求获取该url的资源-浏览器渲染页面并显示

  5. 他趣游玩,两台服务器,一主一从。流量激增可能会遇到服务器处理不过来,网站访问速度变慢,增加服务器,限流。不知道怎么1s查

Donate comment here.

欢迎关注我的其它发布渠道