I developed a dynamic web project in Eclipse. I can access the app through my browser using the following URL:
http://localhost:8080/MyDynamicWebApp
In Glassfish you must also change the file WEB-INF/glassfish-web.xml
/myapp
So when you click in "Run as> Run on server" it will open correctly.