Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Dynamically Refresh JSP's

Reply
Thread Tools

Dynamically Refresh JSP's

 
 
Wells
Guest
Posts: n/a
 
      06-14-2004
Hello all,
I wonder if there is a way to do this, any help would be appreciated.

I have a JSP/Servlets web application deployed in Oracle9iAS. We have need
to send a broadcast message to all users of the application (potentially,
100 users or individual sessions). What I need to do is to be able to
dynamically refresh each JSP a user is currently on if the administrative
user decides to send a broadcast message.

Each JSP is currently programmed with a hidden box which is checked for a
value (the message string) when the JSP loads. If the box is not null then
the Message will be displayed at the top. The problem of course is how to
force the JSP to refresh directly from the server?

Is that possible?
I appreciate any help.
Wells...


 
Reply With Quote
 
 
 
 
mromarkhan@rogers.com
Guest
Posts: n/a
 
      06-14-2004
Wells wrote:

> Hello all,
> I wonder if there is a way to do this, any help would be appreciated.
>
> The problem of course is how to
> force the JSP to refresh directly from the server?
>
> Is that possible?
> I appreciate any help.
> Wells...
>
>



Peace be unto you.

My sources may be dated.
And this is very much
heresay on my part.
But you said "any" help.

There is something called server push
and client pull.

Using Netscape Server Push Technology with ASP
http://support.microsoft.com/default...;en-us;Q250983

Apparently, Internet Explorer (5 <=) does not support
the encapsulation of multiple entities in a response.
http://www.ietf.org/rfc/rfc2068.txt
which is crucial to server push.
http://c2.com/cgi/wiki?MicrosoftInternetExplorer

Microsoft Internet Explorer does support many client pull
technologies.


About Active Channel Features
http://msdn.microsoft.com/library/de...evelopment.asp

HOW TO: Enable Client Pull for Web Servers, Sites, and Folders
http://support.microsoft.com/default...b;EN-US;240774
"
- Periodically force an Internet browser to reload a page
automatically. Typically, this occurs on a page-by-page basis for a
Web site using HTML.
- Prevent browsers from viewing data that may be out of date,
especially on sites where information is updated frequently. Client
pull is implemented through the HTTP header REFRESH and can be used to
redirect to another page.
"

Using META DATA to refresh pages
http://support.microsoft.com/default...b;EN-US;196471

You can also use Javascript
to make a query every now and again,
using setTimeout function.
like
window.setTimeout("getBlog()", 1000);
Where the function javascript getBlog is called
after 1 second or something like that.
Using dhtml makes the whole process seem
seemless.

setTimeout Method
http://msdn.microsoft.com/library/de...setTimeout.asp


An example of a javascript that pulls
James Gosling's blog

<html>
<head>
<title>James Gosling speaks</title>
<style>
.blog
{
float:left;
width:40%;
padding:1em;
margin:8px;
background-color:whitesmoke;
}
</style>
<script>
function getBlog(site)
{
var XMLHTTP = new ActiveXObject( 'Msxml2.XMLHTTP' );
XMLHTTP.Open("GET", site, false);
XMLHTTP.Send(null);
//window.alert(XMLHTTP.responseText);
var xmlDoc;
var root;
var returnString="<div class=\"blog\">";
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.loadXML(XMLHTTP.responseText);
root = xmlDoc.documentElement;
var titleNodelist = xmlDoc.getElementsByTagName("title");
var linkNodelist = xmlDoc.getElementsByTagName("link");
var descNodelist = xmlDoc.getElementsByTagName("description");

returnString+="<b>"+titleNodelist.item(0).firstChi ld.nodeValue+"</b><br>";
for( i = 1; i < titleNodelist.length; i++)
{
returnString+="<a href=\""
+linkNodelist.item(i).firstChild.nodeValue
+"\">"+titleNodelist.item(i).firstChild.nodeVal ue
+"</a><br>";
}
returnString+="</div>";
return returnString;
}
</script>
</head>
<body>
<script>
document.write(getBlog("http://today.java.net/jag/blog.rss"));
</script>
</body>
</html>


Have a good night.
 
Reply With Quote
 
 
 
 
javaseeker
Guest
Posts: n/a
 
      06-14-2004
Hi there,
Dont know if this would be of much help but try out to force refresh the screen
window.opener.location.href="*.jsp".

Use scriptlets to make it server side.

Enjoy..







"Wells" <wshammou-(noSpam)@optonline.net> wrote in message news:<CY6zc.7906$(E-Mail Removed) et>...
> Hello all,
> I wonder if there is a way to do this, any help would be appreciated.
>
> I have a JSP/Servlets web application deployed in Oracle9iAS. We have need
> to send a broadcast message to all users of the application (potentially,
> 100 users or individual sessions). What I need to do is to be able to
> dynamically refresh each JSP a user is currently on if the administrative
> user decides to send a broadcast message.
>
> Each JSP is currently programmed with a hidden box which is checked for a
> value (the message string) when the JSP loads. If the box is not null then
> the Message will be displayed at the top. The problem of course is how to
> force the JSP to refresh directly from the server?
>
> Is that possible?
> I appreciate any help.
> Wells...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i change refresh time of my page dynamically? jensen bredal ASP .Net 4 05-18-2005 08:04 AM
JSP: Session parameters vanish on refresh. How do I keep them on refresh? Per Magnus L?vold Java 1 10-08-2004 02:52 PM
How do i refresh a datagrid from a pop up window without having to refresh the whole page? Pkenty ASP .Net Web Controls 0 05-28-2004 07:06 AM
using refresh button on the menu bar to refresh two frames. Jawahar Rajan ASP General 1 10-01-2003 09:20 PM
Problem with refresh button breaking automatic refresh brian lanning ASP .Net 0 07-29-2003 07:57 PM



Advertisments