Javax.servlet.jsp.PageContext cannot be allowed for type

I see errors below on my jsp page -

javax.servlet.jsp.PageContext cannot be resolved to a type javax.servlet.jsp.JspException cannot be resolved to a type 

I saw a post about this and tried a few things that were suggested. BalusC provided a great contribution - JSTL1.2 and Standard.jar should not be used together. I did this and he fixed the problem for a while - but it reappears. I am not sure if I have more collisions with banks. I defined all banks as dependencies in Maven. Below are the dependencies that I pointed out pom.xml -

 <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> <version>0.1.38</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> <exclusions> <exclusion> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> </exclusion> <exclusion> <groupId>com.sun.jmx</groupId> <artifactId>jmxri</artifactId> </exclusion> <exclusion> <groupId>com.sun.jdmk</groupId> <artifactId>jmxtools</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>commons-configuration</groupId> <artifactId>commons-configuration</artifactId> <version>1.6</version> </dependency> <dependency> <groupId>org.apache.tiles</groupId> <artifactId>tiles-jsp</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.5.6</version> </dependency> </dependencies> 
+36
maven jsp servlets jstl
Dec 29 '11 at 2:58 p.m.
source share
4 answers

You will need to import into your project JSP APIs that are not included in the servlet-api

In my project, the solution is:

  <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> 
+52
Apr 7 2018-12-12T00:
source share

The solution that worked for me is given in this answer . Go to project properties> Runtime Targets> Check the box for the runtime (Apache Tomcat 7 in my case).
All this. Just create a project now and everything will be fine.

+20
Aug 28 '14 at 4:05
source share

Assuming this is a pom for a web application ...

 <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency> 

Some of these dependencies must be installed as provided by the container. You should not associate them with your application. See Maven Dependency Areas . Failure to do so may result in undefined behavior.

Exactly which dependencies are provided depends on the container.

+5
Jan 03 '12 at 11:24
source share

"The solution that worked for me is in this answer. Go to project properties> Target runtimes> Check the box for the runtime (Apache Tomcat 7 in my case). All this. Just create the project now and everything will be fine."

This solution worked for me.

+1
Aug 31 '17 at 7:36
source share



All Articles