"PutListParametersServlet" sets a session attribute and I have a HttpSessionAttributeListener that gets the attributeReplaced correctly called. All I describe so far works correctly.
My intention is to have the original (or first) servlet ("mainServlet") refresh (or redraw) when the session attribute changes. I figured that I could do this from the HttpSessionAttributeListener but I cannot figure it out. The only way I can do this is to have this line in "mainServlet":
which causes a refresh each 5 seconds and then "mainServlet" can refresh after the session attribute change. I suppose I could put logic around a "smart" 5 second refresh but that doesn't seem correct.
What do I need to do to cause all browsers in a session to refresh when a session attribute changes?
Also, I recently passed SCJP and am working on SCJD and studying for SCWCD so am trying to avoid using ajax, extjs, spring, dojo, flash, etc. I have enjoy reading many of the JavaRanch forums. Generally, when I ask a question like this to other developers they say that I'm crazy to not use those other tools.
Thanks for your help,
You can't. From a listener how could you possibly know who is still browsing your app, and who's gone off to look at videos on YouTube?
Kevin Kiddy wrote:What do I need to do to cause all browsers in a session to refresh when a session attribute changes?
Also, I recently passed SCJP and am working on SCJD and studying for SCWCD so am trying to avoid using ajax
I agree. the tools are there to be used. Re-inventing the wheel all the time is a very novice attitude.
they say that I'm crazy to not use those other tools.
From my perspective, when I'm trying to learn web programming it seems especially confusing when there are many tools/technologies (ie ajax, extjs, flex, dojo, spring, etc) that can accomplish the same task. I assume that most of these tools are a wrapper to servlets that hide some soft of servlet complexity. Also, I assume that every 6 or 12 months new tools will be better then the current. Therefore, it seems reasonable to avoid these tools to learn servlet fundamentals esp. when preparing for SCWCD. I think in the beginning of "Head First: Servlets" the authors say to avoid using Eclipse when studying for SCWCD because Eclipse will hide some servlet complexity and then you will not understand the basics of servlets. What do you think? (I'm esp. interested in the opinion of an experienced web programmer.)