A Sunny Commune - Cheng's Blog

« Previous day (Mar 8, 2008) | Main | Next day (Mar 9, 2008) »

http://blogs.sun.com/chengfang/date/20080309 Sunday March 09, 2008

Install JavaEE samples with glassfish updatecenter

This is available in glassfish v2 update release 1 and newer.  Just follow these simple steps to get JavaEE samples, including a quickstart hello webapp:

1, Start glassfish updatecenter

 cd %GLASSFISH_HOME%\updatecenter\bin

updatetool.bat

2, Click "Available Software" tab and then choose "Java EE 5 Samples" in the list of available software

Glassfish updatecenter 

3, Samples are installed at %GLASSFISH_HOME%\samples (Note that this actual location is different from what was documented at the bottom of the above snapshot image.)

C:\glassfish\samples>dir

03/09/2008  05:42 PM    <DIR>          .
03/09/2008  05:42 PM    <DIR>          ..
01/02/2008  11:18 AM            82,562 common-ant.xml
01/02/2008  11:18 AM             1,795 common.properties
01/02/2008  11:18 AM            23,554 GlassFish_LB_Cluster.html
01/02/2008  11:36 AM                28 password.txt
01/02/2008  11:18 AM    <DIR>          quickstart

4, There are currently 2 apps under samples/quickstart: hello.war and clusterjsp.  To deploy hello.war (already built and packaged ready for deployment) using autodeploy, just copy the .war file to %GLASSFISH_HOME%\domains\domain1\autodeploy

5, To run hello webapp, go to the following URL: http://localhost:8080/hello/

Glassfish hello duke

6, To undeploy hello.war, simply delete hello.war from %GLASSFISH_HOME%\domains\domain1\autodeploy