0

When I created a JSP page in Eclipse Neon, the following error message appeared:

"The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path"

When I created a Servlet the following error message appeared:

"The import javax.faces cannot be resolved"

Other answers for the "same" question say there is a common root : the targeted runtime is unselected in the project properties. According to this I have selected the Glassfish 4 server. And I can see the servlet-api.jar in the Java Resources\Libraries\Glassfish Libraries. The servlet error message disappeared but the JSP one lives on. How could I disappear it as well?

The Bitman
  • 1,279
  • 1
  • 11
  • 25
  • Not sure but this might help! http://stackoverflow.com/questions/10961916/error-package-javax-faces-bean-does-not-exist-at-import-javax-faces-bean-manag – npat89 Aug 17 '16 at 19:44

2 Answers2

4

In the configuration POM.xml add the following dependencies, with this the error is corrected

<dependencies>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency>

</dependencies>
JTENORIOH
  • 41
  • 3
0

OK. I have reloaded the project and the error message disappeared.

The Bitman
  • 1,279
  • 1
  • 11
  • 25