Part of the problem is that much of the war was created in Flash/Flex which I don't know. I'm leaning to re-write the script so that it doesn't redirect to other pages and just loads the required data. That way I could run the script when the main page is loaded up.
But if there was an easy way to either
- run the script after JBoss performs the login (a hook some where that I can attach a script to)
- or to set the security so that it will redirect the user to the login page no matter what location they are requesting when not logged in
Also, I should note that the script runs in the login page when the user goes to the log in page and is already logged in. The script redirects back to the main page so in it's current form can not be moved to the main page (would get a redirect loop).