Which version of JBoss AS?
In general, if you configure the app server to bind to localhost or 127.0.0.1 (which is the default), then you can acces the server only from the same machine as it is running on and only using localhost or 127.0.0.1 as the hostname in the URL.
If you configure the app server to bind to a specific IP address, then you can access the app server only using that specific IP address, or any hostname that will resolve to that IP address. You cannot use localhost not 127.0.0.1 to access the app server.
If you configure the app server to bind to 0.0.0.0, then you can access the app server either via localhost or via any hostname that resolves to any IP address configured for that machine. In other words, it binds to any IP addresses supported by the machine.