I have inherited a web application running in JBoss 5.1, it has the Jboss Security set up, using the Form based security. The way it was designed was that a user would go to the login page and then login. Once they were logged in, it would redirect the user to a script that would load the start up data and then redirect them to the main page. This work as designed, but some users have bookmarked the main page. When they go to the bookmarked page while not logged in, they are prompted to login, and then they go directly to the main page without loading the start up data which crashes the app.
Is there a way to either run the script after they have logged in or force them to the login page?
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).