1. managing state between http requests
2. connecting legacy stuff to HTTP responses
3. mapping HTTP requests into a transaction space.
If you can architect thusly, you can use this recipe:
mod_php, mod_perl, etc.
And remember, none of the above are mutually exclusive. Don't pay enterprise-class java grinders to hack html, and vice-versa.