JavaScript:eclipse报错:ServleContext cannot be resolved to a type

eclipse报错:ServleContext cannot be resolved to a type
<%!
    synchronized void submitMessage(String str){
            application=getServletContext();
            count++;
            v.add("第"+count+"楼"+str);
            application.setAttribute("Messages",v);
        }
        Vector<String>v=new Vector<String>();
        ServleContext application;
        int count = 0;
        %>

img

我的解答思路和尝试过的方法 :试过build path添加也没有用
我想要达到的结果

是不是没添加本地的依赖。