1

I am following this Oracle tutorial

One of the Steps is:
Create the RequestProducerBean class Right-click on the obe.beans package and select New -> Other. Choose JavaServer Faces from Categories and JSF Managed Bean from File Types.

I do not have this option in my Eclipse. I have tried several things in the last 4 hours but unable to fix it. I am using GlassFish Tools for Kepler downloaded from this site. Here's a screenshot of when I rightclick>New>Other in PackageExplorer.

enter image description here

Any idea how do I get it installed?

Attaching a screenshot of my ProjectFacets

enter image description here

Arthas
  • 421
  • 1
  • 6
  • 23
  • No Eclipse doesn't have such a wizard built-in, the fact that Netbeans has it is only a minor convenience, in the end it is going to create a regular java class with some annotations already put on it. The bigger problem your screenshot is showing is that for some reason only very old versions of JSF are supported in your project, the tutorial requires JSF 2.1 or 2.2 by the looks of it. What happens when you set the dynamic web module facet to version 3.0 ? Can you then select JSF 2.1/2.2 ? – Gimby Mar 11 '16 at 15:10
  • 1
    After Kepler came Lunar and now Mars... Maybe time to upgrade? And JBossTools plugin is much better in my opinion – Kukeltje Mar 11 '16 at 15:15

1 Answers1

0

I see that version of JSF in your application is 1.1 and 1.2. It is recommended to update it to use JSF(2.0/2.1/2.2).

For your question of creating Managed bean - create a dynamic web project +set dynamic web module facet to version 3.0. +set java server faces to atleast 2.0. - create package of your like in src folder +right click on src folder new -> package(eg: com.firstApp.backing). - create a java class giving name you desire -annote class by

import javax.faces.bean.ManagedBean;
@ManagedBean
public class FirstBean implements Serializable{
    `// your code`
   }
Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
Harish Barma
  • 624
  • 8
  • 15