tags:

views:

648

answers:

3

I have a statement

String pass = com.liferay.portal.util.PortalUtil.getUserPassword(
        renderRequest)

that causes the following error in eclipse IDE:

The type javax.servlet.http.HttpSession cannot be resolved. It is indirectly referenced from required .class files

Why is this error occuring? I have added an import statement for the type but yet the error remains. How can I remove this error?

Thanks for your help.

+2  A: 

It sounds like you haven't referenced the right libraries. Add a reference to servlet.jar.

Jon Skeet
+2  A: 

You need to put the definition of that class (usually contained in a servlet.jar file) into the build path of your project (right-click on the project, select "Properties" and then "Build Path").

Michael Borgwardt
+1  A: 

Check your project setup. If I recall correctly, this has to do with com.liferay.portal.util.PortalUtil.getUserPassword(renderRequest) using javax.servlet.http.HttpSession under the hood, but eclipse isn't able to find that class. Try adding the servlet api jar to the project class path

Vincent De Baere