1. move java code in asp into page data
2. break the logic into small pieces