I’m developing a simple login/logout application with JSF 2.0, GlassFish 3, Eclipse IDE. For some reason I need to implement a filter.
When I’m trying to import the necessary classes I get the following eclipse error:
The import javax.servlet cannot be resolved
I was under the impression that javax packages are included in JDK.
Note: I created a new project without the JSF settings and the import works just fine.
javax.servlet.* is part of the Java EE SDK. You need to add servlet-api.jar to the build path of your Eclipse project. I would imagine you can find it in one of the Glassfish directories.
Edit: The accepted answer to Tomcat 6 conversion to Glassfish v3: servlet-api, el-api jars contains better advice then I have just given you above!