I am working on a JSP project that uses Apache Tomcat 7.
When running the project on its loading index.html it's OK, but when trying to navigate to another page it's showing the error:
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
Please provide me a solution to get rid of this.
Get rid of any servletcontainer-specific libraries such as jsp-api.jar
in your /WEB-INF/lib
folder. This exception indicates that you've put servletcontainer-specific libraries of a container which supports only Servlet 2.4 / JSP 2.0 or older in there (the getJspApplicationContext()
method was introduced in Servlet 2.5 / JSP 2.1). This is a major mistake. Those libraries don't belong in the webapp's classpath.
Perhaps you did this to overcome project compilation errors, which is indeed a pretty common beginner's mistake. This should have been solved differently, you should refer the target runtime in your project, not copy some libraries of an arbitrary servletcontainer make/version into your project. It would make your project incompatible with servletcontainers of a different make and/or version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With