• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

after advice to j_security check

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have a login html page using j_security_check. My web.xml as follows



As you can see LoggedIn.action and LoggedInTwo.action are secure actions. What I want is that after the user logs in a session variable is created containing the users name. Does anyone know if its possible to apply Spring AOP after advice to j_security_check? Or I could apply aop before advice to the secure action classes, however will the request parameter j_username be accessible in my before advice class???
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can customize all the parts of Spring Security. If you just create a UserDetails class and put the value in that, then you don't have to put it into the session, and in jsp pages and in code you have access to the value with the SpringSecurityContextUtil class and with the security tag lib.

This is exactly what we do here, we have the UserDetails object also hold our User object, and we can get access to the values in the User object. Heck if you use Groovy you can put an @Delegate on the User object and call the getters and setters directory from the UserDetails instance.

Mark
 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following appears to get me the username which is all I want

Very simple
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic