The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

前端 未结 4 1052
别跟我提以往
别跟我提以往 2020-11-27 08:04

This is what I got on the browser screen when I try to run the JSP file.

The method getJspApplicationContext(ServletContext) is undefined for the type

4条回答
  •  再見小時候
    2020-11-27 08:15

    The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

    That method was introduced in JSP 2.1. There are 3 causes for this problem:

    1. You're using an too old version of the JSP container (you need for example at least Tomcat 6.0).

    2. You've declared the wrong Servlet version in web.xml. JSP 2.1 goes hand in hand with Servlet 2.5, so your web.xml should at least be declared as per the Servlet 2.5 spec (you still need a Servlet 2.5 / JSP 2.1 capable servletcontainer for that).

    3. You've duplicated older versioned appserver-specific libraries into webapp's /WEB-INF/lib, like servlet-api.jar, jsp-api.jar and so on. You should never do that. It will only result in classloading collisions. Get rid of them in your webproject and leave/untouch them there in the appserver.

提交回复
热议问题