Right-click the Project node, and select New->Java package.
In the Package Name field, type guessNumber and click Finish.
A new package is created and placed under Source Packages node of the Project.
Right-click the Source Packages node and select New->Java Class.
Type the name of the class file as UserNumberBean, select the name of package as guessNumber and click Finish.
A new Java class file is created and opened in the IDE.
Replace the content of the Java class file with the example code from the UserNumberBean.java file listed in Developing a Backing Bean, and save the file.
Create two new XHTML pages and name them greeting.xhtml and response.xhtml respectively:
Right-click the project node and choose New->Other.
The New File wizard opens.
Choose Category as Web and then File Type as XHTML and click Next.
Enter greeting.xhtml in the XHTML File name field and click Finish.
A new XHTML web page is created and placed under Web Pages node.
Repeat the above steps but enter the name of file as response.xhtml to create a second web page.
Edit the XHTML files and add Facelets content to them:
Replace the content of greeting.xhtml with the example greeting.xhtml code listed in Creating Facelets Views and save the file.
Similarly replace the content of response.xhtml with the example response.xhtml code and save the file.
Add Duke's image as part of the application by copying the wave.med.gif image file from the tutorial example and saving it as a resource.
Edit the web.xml file to modify the welcome page to greeting.html.
Right-click the Project Node and select Build from the menu, to compile and build the application.
Right-click the Project Node and select Deploy, to deploy the application to Sun GlassFishTM Enterprise Server v3.
Access the application by typing the following URL in the browser: