diff options
Diffstat (limited to 'js/dojo/dojox/rpc/demos/demo_jabsorb.html')
| -rw-r--r-- | js/dojo/dojox/rpc/demos/demo_jabsorb.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/js/dojo/dojox/rpc/demos/demo_jabsorb.html b/js/dojo/dojox/rpc/demos/demo_jabsorb.html new file mode 100644 index 0000000..8452341 --- /dev/null +++ b/js/dojo/dojox/rpc/demos/demo_jabsorb.html @@ -0,0 +1,70 @@ +<!-- +This file is a demo of the Dojo + jabsorb + +You must have jabsorb installed in order for this to run. +This assumes that jabsorb is at /jabsorb-1.3/, but you +can change the target if it as a different location. + +This uses the Hello example from the jabsorb framework (Hello.java and hello.jsp) +--> +<html> +<head> + <title>Demo of Dojo + jabsorb</title> + <style type="text/css"> + + @import "../../../dijit/themes/tundra/tundra.css"; + @import "../../../dojo/resources/dojo.css"; + </style> + + <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script> + <script type="text/javascript"> + dojo.require("dojox.rpc.Service"); + dojo.require("dojox.rpc.JsonRPC"); + var services = new dojox.rpc.Service({ + target:"/jabsorb-1.3/JSON-RPC", + transport:"POST", + envelope:"JSON-RPC-1.0", + contentType:"application/json", + services:{ + "hello.sayHello":{ + returns:{"type":"string"}, + parameters:[{"type":"string"}] + } + } + }); + function clickHello() { + var whoInput = document.getElementById("who"); + var deferred = services["hello.sayHello"](whoInput.value); + deferred.addCallback(function(result) { + alert(result); + return result; + }) + } + + </script> +</head> + +<body class="tundra"> + <h1> + DEMO: jabsorb + </h1> + <hr> + <h3> + Description: + </h3> + <p> + This simple demo shows how to connect to a <a href="http://jabsorb.org/">jabsorb server</a> + </p> +<p>The jabsorb <em>Hello World</em> application.</p> + +<p> + <strong>Who:</strong> + <input type="text" id="who" size="30" value="Michael"/> + + + <input type="button" value="Say Hello" onclick="clickHello()"/> +</p> +<body> + <hr/> +</body> +</html> |
