Programmer's Rules


Hello world JSF application for Glassfish in a text editor

Only the necessary settings needed to run a minimal JSF application for Glassfish server


1. Open a text editor, e.g. Notepad (on Windows), gedit, nano (on Linux), etc.

2. Write the necessary code to the file:

3. Save the file as index.xhtml.

4. Create a folder WEB-INF. Inside a folder create a new text file and fill it with the following code:

5. Save the file as web.xml.

6. Zip the index.xhtml file and the WEB-INF folder, eg. using 7zip software (with zip format option). The zip inside should look like that:

JSF, Glassfish, Web

7. Change the *.zip filename and extention to hello.war.

8. Open Admin Console of Glassfish. Go to Applications --> Deploy --> Browse and choose the hello.war file. Press ok.

9. Now you can run your application whith url: http://localhost:8080/hello/index.xhtml.


Tutorial statistics