I just find out that it is possible to create public webserver through "preference". Is it possible to make this "webserver" to a Apache Tomcat server? I develop in Java/Jsp/Servlet..
I use Lion and I'm new to Mac
No. The System Preferences setting only activates Apache HTTP Server.
You can set up Tomcat stand-alone yourself, or configure Apache to use mod_jk
to connect to Tomcat as described e.g. here.
Yes of course. But the firewall doesn't make it simple nowadays. In earlier versions of OSX you could add a port exception to the firewall, which isn't possible AFAICS. You can install the Waterroof firewall frontend.
http://www.hanynet.com/waterroof/
Another option is to use apache as frontend to tomcat, using Mod_JK.
https://tomcat.apache.org/connectors-doc/webserver_howto/apache.html
A third option, if you don't need Apache, is to make Tomcat listen to port 80, and disable Apache. Enabling the webserver in the firewall does make OSX start the webserver. So you probably should make Apache use another port as well, say port 9090. Then apache starts, when the firewall starts it, and you start tomcat manually.
TOMCAT
Open server.xml
<Connector connectionTimeout="20000" port="8080"
Should be: port="80"
See https://stackoverflow.com/questions/5544713/starting-tomcat-on-port-80-on-centos-release-5-5-final
APACHE
Edit httpd.conf
listen 80
should be: listen 9090