You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jan Behrens <ja...@diekleinedomain.de> on 2003/03/14 11:48:38 UTC

Model View Controller with JSP

hi list,

i am trying to figure out a way to use the model-view-controller paradigm to
dynamicaly reload a jsp page when the underlying object has been changed by
another user. i would like to achive this without having to use a separate
servlet however...

any ideas, tips or links would be very much appreciated

regards

jan


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Model View Controller with JSP

Posted by Mark Pease <mp...@chartermi.net>.
Hi Jan,

I think you are out of luck with a straight JSP unless you incorporate
Applets to stream the data to.  When you request a JSP page, it is
dynamically generated from the server, but it still follows the HTTP method
of a simple request, which returns the page and the 'connection' is
terminated.

I would recommend either Java Applets, or doing your app in Macromedia Flash
and taking advantage of the XMLSockets talking to a servlet.  This method
would 'push' the data out to the clients as soon as it is updated.  Or, if
you can 'poll' the server for updates (ie it doesn't have to be updated
immediately), you can simply have your applet or Flash app occasionally
request a certain JSP page for new data.

Mark

----- Original Message -----
From: "Jan Behrens" <ja...@diekleinedomain.de>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, March 14, 2003 5:48 AM
Subject: Model View Controller with JSP


> hi list,
>
> i am trying to figure out a way to use the model-view-controller paradigm
to
> dynamicaly reload a jsp page when the underlying object has been changed
by
> another user. i would like to achive this without having to use a separate
> servlet however...
>
> any ideas, tips or links would be very much appreciated
>
> regards
>
> jan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Model View Controller with JSP

Posted by Erik Price <ep...@ptc.com>.

Jan Behrens wrote:
> hi list,
> 
> i am trying to figure out a way to use the model-view-controller paradigm to
> dynamicaly reload a jsp page when the underlying object has been changed by
> another user. i would like to achive this without having to use a separate
> servlet however...
> 
> any ideas, tips or links would be very much appreciated

There's no way for the HTML stream that has been sent by the server to 
the user agent to "know" when something has happened on the server side 
without the user-agent being prompted to re-check the server.  However, 
you can keep an open connection to the user-agent and send it new data 
when necessary -- it is complicated but someone recently posted a link 
to this article on the subject (this is called "pushlets"):

http://www.javaworld.com/javaworld/jw-03-2000/jw-03-pushlet.html


Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org