Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Context and Dependicie Injection on Netbeans (after project creation)

I'm developing a J2EE project with NetBeans. When I created the project I didn't check the "Enable Contexts and Dependency Injection" option.

Is it possibile to change the option after the project creation? Where?

Thank you!

like image 329
fabiofili2pi Avatar asked Aug 31 '11 14:08

fabiofili2pi


1 Answers

Steps -

  1. Right-click your Project.
  2. Go to New and then select Others.
  3. From the Categories list, select Contexts and Dependency Injection.
  4. Then on the right-hand side, from File Types list select beans.xml (CDI Configuration File)
  5. Click Next and Finish leaving the file-name to defualt (i.e. beans).

That's it. It creates the beans.xml file and it's enough to tell Java EE-compliant server that your project is a module containing CDI beans.

I found this -

The 'Enable Contexts and Dependency Injection' option, when selected, generates a beans.xml file in the project's WEB-INF folder when the project template is created. The beans.xml file is used by CDI to instruct the Java EE-compliant server that the project is a module containing CDI beans.

from here.

like image 89
Bhesh Gurung Avatar answered Oct 13 '22 06:10

Bhesh Gurung