IDEA中,在jsp页面中,出现不能智能显示方法pageContext.setAttribute

IDEA的使用

在jsp页面中,出现不能智能显示方法pageContext.setAttribute在这里插入图片描述

这里的setAttribute是手敲的,不是智能提示的 写完之后飘红 无法正常使用

  • 原因:项目中没有引入jsp的包
  • 解决(在maven中添加以下依赖)
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
    
发布了56 篇原创文章 · 获赞 14 · 访问量 6258

猜你喜欢

转载自blog.csdn.net/qq_41154522/article/details/103046237