代码之家  ›  专栏  ›  技术社区  ›  walnutmon

ServletContext getContextPath()

  •  5
  • walnutmon  · 技术社区  · 14 年前

    I checked the javadocs of the Tomcat library I have included under my Netbeans project, and when I deploy the code works fine, but when I do a clean-build of my web project I get a "cannot find symbol" on the getContextPath() method of the ServletContext interface

    It's driving me completely insane because in order to run my tests and so on I have to first deploy, then test, if I clean and build, or clean and run tests I get this error...

    Anyone have any clue what could be causing this issue? Is there a library I have to update or something?

    1 回复  |  直到 10 年前
        1
  •  7
  •   Jon Skeet    14 年前

    I suspect it's not in the version of ServletContext docs of version 2.5 it was introduced 在里面 2.5。So basically change the servlet.jar you're building against to be the 2.5 one, and it should be fine.