Error “package javax.faces.bean does not exist” at import javax.faces.bean.ManagedBean

前端 未结 4 1372
-上瘾入骨i
-上瘾入骨i 2020-12-19 02:11

I am studying JSF from Oracle online tutorial. While building its example \"hello1\" on netbeans it gives the following error at the line import javax.faces.bean.Manag

相关标签:
4条回答
  • 2020-12-19 02:32

    For gradle :

    'com.sun.faces:jsf-api:2.2.8'

    'com.sun.faces:jsf-impl:2.2.8'

    0 讨论(0)
  • 2020-12-19 02:33

    Add these 2 dependency in your project's pom.xml file

    <dependency>
      <groupId>com.sun.faces</groupId>
      <artifactId>jsf-api</artifactId>
      <version>2.1.7</version>
    </dependency>
    <dependency>
      <groupId>com.sun.faces</groupId>
      <artifactId>jsf-impl</artifactId>
      <version>2.1.7</version>
    </dependency>
    

    This will solve your dependency problem.

    0 讨论(0)
  • 2020-12-19 02:50

    You have to add javax.faces.api jar file to your project. You can find this library here.

    After downloading this file, you have to import that into your project and add it to your artifact.

    0 讨论(0)
  • 2020-12-19 02:50

    If you use Netbeans you can search for the library javax.faces.jar in the same folder of this application, you may find it in a folder like this: C:\Program Files\NetBeans 7.3.1\enterprise\modules\ext\jsf-2_2.

    Now, right click on yourProject/libraries in Netbeans then choose Add JAR/Folder... command to add javax.faces.jar file.

    Adding javax.faces.jar library

    From the same popup menu you can use Add Library and add Java EE from GlassFish

    Adding Java EE from GlassFish library

    Good luck.

    0 讨论(0)
提交回复
热议问题