Wednesday, 20 March 2013

'package javax.servlet.http does not exist' Solution

This is a common error which occurs when trying to compile a web project. This package is usually provided by the container. However, it is not (always) available at compile time and one should not include it in the final .war too.

If you are using Maven, the solution is simple. Add the following dependency with the provided scope:
Your IDE will be able to compile your project and won't include the library in your .war.

You can also use the following dependency:

1 comment:

  1. Thanks a lot !! It helped to me to solve the issue !!