aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes About the book Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "About the book" Watch "About the book" New topic
Author

About the book

Roger F. Gay
Ranch Hand

Joined: Feb 16, 2007
Posts: 349
I've read the description at amazon.com ...

I've been moving in and out of technical work for some years ... at the age where my breadth and wisdom seem to be needed much of the time more than programming skills. But JavaScript is one of my favorites, and I'm a big fan of dhtml coupled with JavaScript communication with outside processes. I give you this background, because ... if you read between the lines, you�ll see someone skipping in time like a rock skipping on water, picking up knowledge at each hit, but not between.

I loved Netscape's LiveConn. Later, I built my own general support for interacting with servlets through iframes. I occassionally search the web looking for evidence that something like LiveConn is now supported in standard JavaScript. I think I have found the evidence, and it looks like something like that has been in the JavaScript standard for a couple of revisions.

OK ... so half way through making a short question long ... I have the opportunity to define, if not build myself some pretty cool AJAX stuff that sometimes isn't always entirely "user-centered." I mean, I want asynchronous intereaction with back-end processes, but not just responses to clicks. Once communication starts, some processes may decide to provide updated information at any time, time and time again. This was easy enough to do with LiveConn and the iframes approach.

What I really want is that seamless use of JavaScript / Java (or other) that I got using LiveConn.

Given that: Is "AJAX in Practice" the book I'm looking for?


Correlation does not prove causality.
Jord Sonneveld
Author
Ranch Hand

Joined: Apr 09, 2007
Posts: 31
Originally posted by Roger F. Gay:
I mean, I want asynchronous intereaction with back-end processes, but not just responses to clicks.

Definitely possible. You could use Prototype's periodical updater, which we cover.

Once communication starts, some processes may decide to provide updated information at any time, time and time again. This was easy enough to do with LiveConn and the iframes approach.

What I really want is that seamless use of JavaScript / Java (or other) that I got using LiveConn.

Given that: Is "AJAX in Practice" the book I'm looking for?

Definitely. We have a few examples that will show you how to do periodic updates. However, if you want the server to send messages to the client and have them appear instantaneously, I do not believe we cover that. Of course, it's easy to do: just use DWR's 'Reverse Ajax' functionality. You can find DWR at http://getahead.org/dwr and more info on its Reverse Ajax functionality at http://getahead.org/dwr/changelog/dwr20

Roger F. Gay
Ranch Hand

Joined: Feb 16, 2007
Posts: 349
Thanks. I appreciate the outside references focused on what I'm looking for. "It [DWR] allows code in a browser to use Java functions running on a web server just as if it was in the browser."

- A Java Servlet running on the server that processes requests and sends responses back to the browser.
- JavaScript running in the browser that sends requests and can dynamically update the webpage.

Perhaps I haven't read far enough yet, but what seems to be missing (compared to LiveConn) is the ability to call JavaScript functions from Java programs; thus triggering a page event whenever the Java program has something to send.

Are you sure this stuff isn't supported in standard JavaScript?
[ April 14, 2007: Message edited by: Roger F. Gay ]
Jord Sonneveld
Author
Ranch Hand

Joined: Apr 09, 2007
Posts: 31
Originally posted by Roger F. Gay:
Perhaps I haven't read far enough yet, but what seems to be missing (compared to LiveConn) is the ability to call JavaScript functions from Java programs; thus triggering a page event whenever the Java program has something to send.

Do you want to call browser-side JavaScript from a browser-side Java applet? Or from server-side Java?

javascript / applet interaction : http://www.raditha.com/java/javascript.php
javascript / server-side java interaction : DWR reverse Ajax allows this.

Make sure you're reading the DWR 2.0 docs, as Reverse Ajax was introduced in that version. You can see a small sample at Joe's blog at http://getahead.org/blog/joe/2006/04/11/1144770216929.html

Are you sure this stuff isn't supported in standard JavaScript?

Server-side Java / Client-side JavaScript interaction is not supported right out of the box, by which I mean, there is no clear, well-defined standard API for doing this.

That doesn't mean that it isn't possible to write such an API that uses XHR to create this effect; that's what Joe has done w/ DWR.





j\s
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About the book
 
Similar Threads
Practical JavaScript, DOM Scripting and Ajax Projects
AJAX, JSF and security
Slimming AS 5
Frameworks? Do I need one? want one?
Passing value to JSP from a method in Action class