derguteonkeldod wrote:
> Thank you very much for this explanation, Peter!
> 
> A link that explains in detail with examples the servlet-JavaScript
> interaction is further more very apprechiated.
> 
> 
> --- In svg-developers@yahoogroups.com, Peter Thompson
> <[EMAIL PROTECTED]> wrote:
>> There are lots of people here who can explain this.
>>  
>> Generally, SVG and JavaScript are both running in a browser on a
> client.  SVG communicates with JavaScript via events.  JavaScript
> updates the DOM, which is the in-memory representation of the SVG. 
> See this link for a working example of JavaScript/SVG interaction:
>> http://www.w3.org/TR/SVG11/script.html#EventHandling
>>  
>> The Java Servlets run on a web server that supports servlets (e.g.,
> Tomcat).  The client JavaScript that is embedded in the SVG can
> communicate with a servlet via getURL() and postURL() calls.  For
> example, the client can call getURL(url, callback) to execute the
> doGet() function in a servlet.  In Tomcat, the url is mapped to the
> servlet via the web.xml file.  The doGet() function on the server
> returns a result to the client, which causes the callback function on
> the client to be called.  The callback function parses the results and
> updates the DOM, causing the display to be updated.
>>  
>> getURL() and postURL() are supported by the Adobe SVG and Batik
> viewers, but not all viewers.  
>>  
>> I don't know of a link that explains in detail with examples the
> servlet-JavaScript interaction (maybe someone else can provide this).
>  If you know how to do servlets on your web server, then getting them
> to work with client JavaScript and SVG isn't difficult.

I learn how to do servlet this week, so such topic suddenly has some 
interest for me...

I think Peter gave an excellent explaination on how to proceed.
I googled for [svg geturl posturl] and found this page:
http://jibbering.com/2002/5/dynamic-update-svg.html
which is a very clear explaination on how to use getURL.

The core of the mechanism is getURL. For a servlet, I suppose you can 
use something like:

getURL('/SVGWebApp/servlet/SVGDataGenerator?clickedButton=' + buttNb, 
callBackFunction)

The servlet handles the parameters (Jim uses no parameter at all, which 
is fine for just outputting data evolving with time) in the doGet, and 
spits out a file containing either plain text data or XML (perhaps SVG 
fragments), which can be parsed in the callBackFunction using the 
obj.content (and perhaps the obj.contentType if needed).

Sorry, I am only paraphrasing Peter and Jim, but I though that 
formulating it (slightly) differently could help understanding.

Right now, my schedule doesn't allow me to experiment with this, 
although I find this exciting, so I will think of a possible application 
(one could show, eg., a graph showing off the CPU/memory load of the 
server, if he/she know how to get this info in Java) and experiment as 
soon as possible.

Of course, if I ever find time for this, I will make the results public, 
here and/or on my site.

-- 
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  For servers mangling my From and Reply-To fields,
--  please send private answers to PhiLho(a)GMX.net
--  --  --  --  --  --  --  --  --  --  --  --  --  --


-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to