Hi Any event listener like HttpSessionAttributeListener,ContextAttributeListener etc. .But want to get notification on browser(means in a jsp page ) showing some message .Please explain with an example. [ May 10, 2008: Message edited by: pradeep singh ]
If you're asking what I think, you cannot do this with just Java because HTTP is a stateless protocol - so the connection between the server and the browser is lost once the request completes (typically a very short cycle).
Have I understood your question correctly?
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )
Pradeep : why do you care to display the values on browser.If you are preparing for exam then please don't bother because the exam does not go that far.
but here is an example but it doesn't do what you want ,by the way.
best regards, omi
[ May 11, 2008: Message edited by: omi sharma ] [ May 11, 2008: Message edited by: omi sharma ]
Joined: Mar 27, 2003
why do you care to display the values on browser.
It's a good point - there is very little reason to propagate (the results of) container events to the browser as they probably don't model exactly what behaviour you'd want. There might be educational value in it, but it won't be tested on the exam nor will you probably ever use it in production.
I guess you're thinking about something like session timeout (and subsequent destruction) as "logging a user out"? Probably easiest not to bother showing your users this though until they click on another page and find they've been logged out, as typically happens with online banking. Also if you're not careful the process of checking the status of a session using AJAX principles will in fact reset the timeouts so your user's session never times out while they have at least one page open - which could be useful for maintaining relatively current "user online" counters I suppose.
Joined: Oct 23, 2007
Hi I am not asking this question for the exam point of view.I was asked this question in interview?