I have also installed a Tomcat 7 as shown in the picture below and I can successfully access http://localhost:8080 from Firefox within the CentOS virtual machine.
However, I am not able to access http://localhost:8080 outside the centOS virtual machine (i.e. I am not able to access the website from my host Yosemite web browsers like Safari or Firefox).
Here are my centOS7 network settings from within Virtual Box:
With the above network settings, I am able to connect to the internet within the CentOS virtual machine. But I can't connect to the host machine.