Unfortunately, when I tried to launch the project, it was not reading properly static resources (e.g., CSS files), since Glassfish has an XML configuration file (which is a substitute of the plain old web.xml file) in which you specify the context root of your project, i.e.:
http://localhost:8080/context-root/the-page-you-want
Tomcat is configured so as to use as context root the name of the project. So, how to fix this?
A solution can be found here, and is applied as follows:
- Project -> Properties -> Web Project Settings
- Modify the context root with the name you want and confirm
- Stop Tomcat
- Clean the Tomcat server by right-clicking on the server itself and selecting Clean
- Restart the server
- Confirm that you want to change the context root
...and you are done!