0

I recently moved a bunch of classes from a webapp to some standalone library.

Eclipse complained that HttpServletRequest was not resolved, so I added Web App Library to my Java Build Path/Libraries (following StackOverflow guidance)

=> Didn't change a thing although "Web App Libraries" is now included in my Libraries.

How can I get HttpServletRequest to be resolved without webapp dependancies?

Edit: Removing "Web App Libraries" and adding servlet-api.jar found in Apache6 ./lib/ folder did the trick.

I just hope I am not creating a dependancy on Tomcat version.

subodh
  • 6,136
  • 12
  • 51
  • 73
MonoThreaded
  • 11,429
  • 12
  • 71
  • 102
  • 1
    Important: http://stackoverflow.com/questions/4076601/how-do-i-import-the-javax-servlet-api-in-my-eclipse-project – Eich Apr 11 '13 at 08:58
  • Does not apply to libraries. All these posts assumne you have control over Target Runtime which is not true for Libraries. – MonoThreaded Apr 11 '13 at 09:04
  • My main intention was that you need a servlet container to use such libraries (`servlet-api.jar`) :) . – Eich Apr 11 '13 at 09:14

1 Answers1

0

As per the edit : Removing "Web App Libraries" and adding servlet-api.jar found in Apache6 ./lib/ folder did the trick.

MonoThreaded
  • 11,429
  • 12
  • 71
  • 102