Simplified servlet logic.

Improvements to servlet and jsp code.