OK, so VisualVM is simply going to look at the JVMs running. When you have a Web application running within Glassfish, there is a JVM that contains Glassfish (inside of which your web application is hosted). VisualVM is only able to see what is running at the JVM layer. It's not going to look at the JVM hosting glassfish any differently than it would if you directly ran a Java class using the command-line approach.
Unless there is a VisualVM plugin for Glassfish out there that knows how to query the relevant JMX beans to extract the Container details defined within, stock-standard VisualVM will just look at the container as any other JVM.
If you want to see what Web Applications (or anything else, for that matter) are deployed within your Glassfish container, you could use it's web console, or its JMX interface if you want to programmatically inspect it.