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

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

 

Making making when writing JSP code, the followingpageContextWill report an error.

     <a href="${pageContext.request.contextPath }/comm/activate_user">The number of active users</a>

Making making mistakes:

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

 

     The reason and solution: Write time error, was released to the jetty after the normal operation, this is because the jetty has jsp-api.jar.

Making making so, the solution is the jetty installation directory under the jsp-api.jsp (or Tomcat) copy to the project's lib directory.

Making making and play spaces, to save the JSP file can be.

    

Making making Maven add on:

    

		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>jsp-api</artifactId>
			<version>2.2</version>
			<scope>provided</scope>
		</dependency>

 

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Dunn at December 03, 2014 - 4:51 PM