I asked this question in the SCWCD forum, but it seems that nobody wants to answer it and I'm quite curious and being as this isn't directly related to the SCWCD forum, I figured I'd give it a shot in here.
I'm having a hard time figuring out when listeners are helpful. If you know when you add an attribute and you know you need to use the attribute that you added, why not just do the work then? Why do you need a listener?
Here is my example... If there is a better example that shows why to use a listener, by all means, let me know.
Let's say someone submits a form for a shopping cart, you have a doPost method and you handle them adding an item to their shopping cart (storing the stuff in the database or session data, whatever...) Then they move on to shopping and add more items, etc... Then they go to checkout. You have a
servlet to handle checking the person out too... The checkout pull the session data, charges them checks them out... we're done.
At what point would there need to be a Listener to help with that application? Why does a class need to be sitting around waiting for another class to add a parameter or attribute??