On Tue, 2004-10-19 at 10:48, Harald Henkel wrote: > Hello. > > Steve Kirk wrote: > > > > Not sure if this is stating the obvious, > > No, it doesn't. > > > or this is the approach you've > > already taken, but it's not necesary to refresh the whole page that is > > displaying your data every few seconds. You can have an invisible frame > > that runs the JS timer that you describe. That frame could have > > src="/mywebapp/DataUpdateCheck" which is a servlet that returns just a > > simple js function - if there is new data, the function reloads it into the > > visible frame, otherwise it reloads itself after a couple of seconds to > > check for more data. > > Well, it's not the page/frame itself doing the refresh, but in fact the > frame definition page, which includes the refresh code. > There is also another timer, which creates some blinking (requested by > the customer ;-) ) by changing the css classes of some HTML objects in > about half second intervals. Since none of these are Tomcat specific issues, I'm marking this thread [OT].
> > > Do you have some example code of how this works ? > > I guess this seems to be a stupid question for somebody creating some > more or less complex JSP+JavaScript Web application, > but what exactly is a servlet ? Of course I heard this a lot. > Is it some Java class ? Yes, a servlet is a Java class. Your JSPs get compiled into servlet code by Tomcat before being compiled to a class file. You can see them in your TOMCAT_HOME/work directory. > How do would I make this known to Tomcat ? By declaring them in your deployment descriptor (web.xml). > Some pointers (links) to good online documention for this ? This is a good place to start. http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/index.html This is also good (but getting a little dated): http://pdf.coreservlets.com/ Good-Luck -Ben > > > I didn't know about the > > <META HTTP-EQUIV="Refresh" Content="1;URL=/GuiDeBook/"> > > mentioned by Edoardo Panfili, but I cannot use it here anyway, because > by some keyborad input (function key) in another frame, > I must be able to stop the updateing immediately (i.e. not realoding the > page before). > The user can then use the scroll keys to select a value in that frame, > while usually the focus remains in the primary input frame. > To make "sure" the user doesn't try to switch the mode, while currently > updating (and for general information) I show the remaining time in > another (third) frame, together with some additional information (a > "legend" for the refreshing frame, or selectable values an input field > in the main input frame). > > All this works quite well now (besides some trouble with database > sessions, which see to be solved, too). > But this is used to create orders for driverless vehicles and it would > be nice to have it more to the time and/or less "flaschy". > > With kind regards, > Harald Henkel > > > > > > -----Original Message----- > > > From: Steve Kirk [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday 19 October 2004 12:41 > > > To: 'Tomcat Users List'; [EMAIL PROTECTED] > > > Subject: RE: Push-Server with Tomcat > > > > > > > > > > > > Seems to me that browsers are inherently "pull" technology > > > because at the > > > basic level they send a single request and await a single > > > response to it. > > > You can't push stuff at them that they haven't requested. > > > Hence why you > > > have to use an approach like your javascript - which, by the > > > way, I have > > > used in the past in a web-based control system without > > > problems - it might > > > not feel that elegant, but it does work. > > > > > > I would think that to get a true push approach you would have > > > to extend the > > > browser capabilities using a plugin of some sort, e.g. java > > > applet / activex > > > / etc. Never tried this myself though so can't comment if > > > this will solve > > > it. > > > > > > > -----Original Message----- > > > > From: Harald Henkel [mailto:[EMAIL PROTECTED] > > > > Sent: Tuesday 19 October 2004 09:51 > > > > To: Tomcat Users List > > > > Subject: Push-Server with Tomcat > > > > > > > > > > > > Hello everybody. > > > > > > > > Is it possible (with Tomcat) to write an application that, > > > > once startet > > > > will send a new HTML page to a client, genereated using changed data > > > > from a database ? > > > > > > > > What I want to do is using oracle alerts to alert a waiting Tomcat > > > > thread of changed data, let it collect the data and generate > > > > one or more > > > > HTML pages sent to different clients, i.e. a specific frame in the > > > > browser on the client. > > > > > > > > Or would I have to have a Java app runing in that frame ? > > > > > > > > At the moment I'm doing this using a JavaScript timer on the client > > > > requesting a new page for that frame every couple of seconds, > > > > but for this application push would really be better. > > > > > > > > With kind regards, > > > > Harald Henkel > > > > > > > > -- > > > > Harald Henkel > > > > > > > > GS automation GmbH > > > > WinterstraÃe 2 > > > > 82223 Eichenau > > > > Germany > > > > Tel: + 49-8141-35 731-37 > > > > Fax: + 49-8141-35 731-38 > > > > Mobile: + 49-178-7829126 > > > > e-mail: [EMAIL PROTECTED] > > > > Web: www.GS-automation.DE > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
