This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Application scope attribute listener

 
Maurizio Nagni
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSF application. In the faces-config I have defined


then I created a class (implementing the proper methods)


and I declared it in the web.xml



The question is:
Why I cannot see the appHandler class added to the Application scope?

in the ServletContextAttributeListener.attributeAdded method I have implemented simple code like


but no messages about the appHandler appear. Hints?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your message is not related to SCWCD, so I move it to a relevant forum.
 
Ryan Lubke
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Maurizio Nagni:
I have a JSF application. In the faces-config I have defined


then I created a class (implementing the proper methods)


and I declared it in the web.xml



The question is:
Why I cannot see the appHandler class added to the Application scope?

in the ServletContextAttributeListener.attributeAdded method I have implemented simple code like


but no messages about the appHandler appear. Hints?



Managed beans will only be created the first time they
are referenced within a view (i.e. #{appHandler}). This
is why your attribute listener isn't printing anything.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic