model cannot be resolved

问题遇到的现象和发生背景

servlet向jsp传值的时候,model.addAttribute()报错,model下面红线:model cannot be resolved

用代码块功能插入代码,请勿粘贴截图
        String city = request.getParameter("city");
        UserDaoimpl dao = new UserDaoimpl();
        ArrayList<User> AQIlist = dao.findBycitytoAQI(city);
        ArrayList<User> timelist = dao.findBycitytotime(city);
        JSONArray AQIarray = new JSONArray();
        for(User a : AQIlist){
            JSONObject joa = new JSONObject();
            joa.put("AQI", a.getAQI());
            AQIarray.put(joa);
        }
        JSONArray timearray = new JSONArray();
        for(User a : timelist){
            JSONObject jot = new JSONObject();
            jot.put("time", a.getTime());
            timearray.put(jot);
        }
        model.addAttribute("message", AQIarray.toString());

运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

没看到你声明model这个变量

既然你是servlet向jsp传参,为啥还要用model啊,直接 往session里放就可以了啊
比如

HttpSession session = req.getSession()

session.setAttribute("message", AQIarray.toString())