• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts login authnentication session process

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic