Friday 6 July 2012

Glassfish-integration with Netbeans and Eclipse



NetBeans


NetBeans 6.1 provides out-of-the box integration as it is bundled with GlassFish.
Just keep the default setting “GlassFish V2 UR2″ enabled during installation process.


In this way GlassFish is automatically installed, configured and ready-to-use: simply press “Run” on any web project!
However, if you would like to declare another installation of GlassFish go to Tools → Servers → Add 
Server…


Select the proper version, specify the name and click “Next.


Provide the installation path of GlassFish through the “Browse” button and click “Next” to configure the password or “Finish” to complete.
That’s it!

Let’s create a simple web application to test it. Go to File → New Project… → Web → Web Application → Next → Specify the Project Name → Finish


The project should appear on the Projects tab. Edit the code of index.jsp and change <h2>Hello World!</h2> to <h2>Hello Worldfrom GlassFish!</h2>
Now simply right-click on the project and select “Run”!

Eclipse


If you are behind a proxy make sure you have properly configured the network settings for HTTPs also. Window → Preferences → General → Network Connections and make sure the option “Use this proxy server for SSL” is checked → Apply → OK → restart Eclipse.


Open the Servers view: Window → Show View → Other… → Server → Servers


On the Servers tab right-click → New → Server


Click on the “Download additional server adapters” link.


Click on the GlassFish Java EE Server option and press “Next”.


Afte reading and accepting the CDDL licence press “Finish” and OK at the prompt message. After a while Eclipse will restart.

Now go the Servers tab right-click → New → Server and select “GlassFish”.


Note: The plugin for brand new GlassFish v3 Technology Preview 2 is already available!
Select the version of GlassFish you have installed and press “Next”.


Provide the installation directory of GlassFish and click “Next”.


That’s it

No comments: