• 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

Struts2 Scope Interceptor - newbie

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,
im new to the forum and also new to Struts2.
I am trying to implement Scope Interceptor, let me explain my app.

I want to store user information from DB into session from login window, so i can validate logged user across application.

I have AppUser.class (which is my model class)



I have this struts.xml , where Login page will go to the loginServiceAction.class where i need to Scope Inteceptor to be used and store (after returning response) my property/model "AppUser" into session.

struts.xml



loginServiceAction.class




Problem is:
Scope interceptor will not store anything into session and will not get that/nothing from it.
Is there some error in my code ?

Thank you
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did not read all your codes but it looks like you are trying to use a new AppUser object in your loginServiceAction class to check if user is logged in. This will not work since it is initialized to default values. You need to do:

 
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic