PHP for dynamic content. Open Source. Very good if you want to develop fast. The engine is also really fast. It also provides best support to MySQL (other type SQLs also supported). Very good for private website and small till middle size company.
Perl: like PHP. Notorious for difficult to be learnt by beginner because of its vast libraries. Unlike PHP, Perl allow you to build the GUI.
Python: like Perl. It has much smaller learn curve.
Java (J2EE) for dynamic content. It takes much longer to develop compared to PHP. But it is far more scalable. It is very suitable in corporate and enterprise environment.
.NET: just like J2EE, just in this case the technology comes from Microsoft. And unlike J2EE, .NET is not platform-independant (although MS claims something differently)
Not that, in Web development, you can hardly use any of these technologies in isolation. In fact, all of the technologies require some use of HTML since that's how all web pages are ultimately displayed. Because of this, I don't think it is really valid to compare Java with HTML and also because, as previously stated, they serve different purposes.
Also, CGI doesn't *have* to be written in Perl. In fact, you can write CGI scripts in Java, C++, or any other language that allows you to read stdin and write to stdout. However, doing web development in Java this way is probably not the most efficient use of the language. Typically Java Web development is done with Servlets or some other J2EE technology.