[Solved] IDEA JSP File out.println Error: Cannot resolve method ‘println(java.lang.String)’

Idea uses out in JSP Print error

As follows:

report errors:

Cannot resolve method ‘println(java.lang.String)’

1. My solution:

Create the Lib directory under WEB-INF

Find two jar packages and add them to lib

As shown in the figure:

After copy, select jsp-api.jar, right-click, Add as Library.

servlet-api. Jar. the same to previous one, right click Add as library

Find the Artifacts of Project Structure, double-click the jar package in the figure, and then click OK

At this time, we still report an error and need to restart idea. After restarting, we find out Println red fades and the problem is solved

Other Solutions (You can Take a Try):

2. Direct file -> Invalidate Caches-> Invaliadate and Restart

3. Associate Tomcat to file -> Project Structure-> modules-> Dependencies-> Add library

4. When creating a new Java project, you should select Java Enterprise instead of webapplication in Java Java Enterprise will automatically associate Tomcat to dependencies)

Read More: