Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Autowiring Session Component into Singleton Controller

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I have been struggling with this problem for couple of days, I think I tried most of Stack Overflows answers and suggestions and still nothing.

I would like to inject Session scoped Component into Singleton scoped Controller but everytime autowired component have properties set to null.

My Component that I woud like to Inject:



My two controller that need to share data:





My applicationContext,xm - important parts:



While debugging I noticed following details, picture below should explain it:



Even that I set my values they appear to be null (or that may be just some debugger flickering) therfore when I want to use that values in TwitterAuthorizationController I can't because they are always null.
Anyways I turn to You because I can't figure this out.


EDIT:

The main goal of controllers are to use Twitter OAuth to redirect me back to my site after successfull authorization.
This is what I noticed:
When I enter /ProfileSocialMedia values are being set correctly.
When i enter /TwitterSuccessAuth MANUALLY everything is correct.
But when TWITTER redirects me to /TwitterSuccessAuth Session is somehow lost. Is there any solution to that?

EDIT v2:
It is resolved. Due to my stupidity I was telling Twitter to redirect me to 127.0.0.1:8080/MyServer/TwitterSuccessAuth but my GlassFish is launched at localhost:8080 and that caused cookies to be incompatible. Chaning Twitter redirect URL to localhost:8080 fixed the issue.
 
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic