can not implement the missing methods,either due to compile errors or the projects build path does not resolve all dependencies
在项目中需要使用struts2的上传,由于需要获取绝对路径,所以需要实现ServletContextAware,可是在实现其方法时总是弹出上面的错误提示;
上面的错误提示的意思是:不能实现丢失的方法,或许是因为编译错误或者工程创建的路径不能解决所有依赖;也就是缺少Servlet相关的jar包了,这里是servlet-api.jar
解决办法:添加servlet-api.jar。
这个jar包可以在tomcat的lib目录下找到,复制到你的项目中去就可以了。
时间: 2024-07-29 02:38:21