First of all, compile the Controller and Model classes using javaeeJar in class path. The GlassFish lib folder contains this javaeeJar, which in turn contains the servlet api.
After compiling the controller and model Java files, it's time to deploy the Web application. First copy the controller and model.class files in the classes folder of the WEB-INF directory.

Name:  Deploying the Web application on GlassFish.jpg
Views: 1498
Size:  54.1 KB

Then start the GlassFish server and log in. Go to the applications branch of the tree as shown.Then go to the Web application branch. Check the radio button for "Local packaged file or directory' and click the 'browse' button (Figure 5). It will show a 'directory chooser'. Choose the prime generator (folder) that contains our Web application. Then click on the OK button. That's it! You have successfully deployed the application and will see a page like what's shown.