rewrite pending events page from perl to java