I want all users to be able to access a number of applications but only specific users to be able to specific applications. For example, if a user selects an restricted item from a menu, a completly seperate small pop-up window would appear requesting a valid user name and password. I also want to time-out a session if a pre-determined idle time has passed causing the user to re-login. Are there any examples I can look at? Or can anyone point me in the right direction? Thanks.
You can set the session timeout period either programmatically, or through the web.xml deployment descriptor. Here are some examples: Programmatically: session.setMaxInactiveInterval(numberOfSecondsBeforeInvalidation); In Deployment Descriptor: <session-config> <session-timeout>30</session-timeout> <!--THIS IS IN MINUTES--> </session-config>
To authenticate with the container, you can create a JSP page with a form that has an action set to "j_security_check," the textfield, "j_username," and the password field "j_password." Then, set up your deployment descriptor to forward to this page when logging in is required. Finally, set up the appropriate url patterns that you want security to apply to.
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
Gift giving made easy with the permaculture playing cards