The method getServletContext() is undefined for the type HttpServletRequest 报错

  • Post author:
  • Post category:其他


报错方法:request.getServletContext().getAttribute(“name”);

改为以下方式可解决:request.

getSession()

.getServletContext().getAttribute(“name”);



版权声明:本文为suya2011原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。