Here is rather big and, let's say, complete example of mod_java usage:
https://starpound.svn.sourceforge.net/svnroot/starpound/trunk/src/fs2agi
The goal of this project is to be a proxy between FreeSwitch and server application which knows Asterisk AGI.