-
1. Re: Client-side Seam remoting calls from a static web page o
samdoyle Jul 31, 2007 6:02 PM (in response to art_jones76)Which version of Seam are you using? I wasn't able to get the remoting working with the head version of 2.0.
-
2. Re: Client-side Seam remoting calls from a static web page o
samdoyle Jul 31, 2007 7:22 PM (in response to art_jones76)btw you can't make cross domain ajax requests.
-
3. Re: Client-side Seam remoting calls from a static web page o
shane.bryzak Jul 31, 2007 10:49 PM (in response to art_jones76)Are you setting Seam.Remoting.resourcePath? View the end of the source for the interface.js that is generated within your Seam app to see how this is set.
-
4. Re: Client-side Seam remoting calls from a static web page o
art_jones76 Aug 1, 2007 9:02 AM (in response to art_jones76)I am setting the Seam.Remoting.resourcePath, but it's still not working. Am I setting it correctly? Here's the code:
<script type="text/javascript"> //<![CDATA[ function sayHello() { alert (Seam.Remoting.resourcePath); Seam.Remoting.resourcePath = "http://localhost:8080" + Seam.Remoting.resourcePath; alert (Seam.Remoting.resourcePath); var name = prompt("What is your name?"); Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback); } function sayHelloCallback(result) { alert(result); } // ]]> </script>
Both pages (the one in the application, and the static one outside the application) alert the same before and after values for Seam.Remoting.resourcePath:
Before: /a/seam/resource/remoting
After: http://localhost:8080/a/seam/resource/remoting
The page served within the application works.
The static page server from outside the application shows the red "Please wait..." dialog, but never returns. Logging within the server-side function shows the function is not getting invoked.
Any thoughts? -
5. Re: Client-side Seam remoting calls from a static web page o
shane.bryzak Aug 1, 2007 8:46 PM (in response to art_jones76)Does the request hit ExecutionHandler? Set a breakpoint in ExecutionHandler.handle() and see if it gets hit when you send your request.
-
6. Re: Client-side Seam remoting calls from a static web page o
art_jones76 Aug 2, 2007 11:54 AM (in response to art_jones76)The client-site code on the DYNAMIC page served from the application DOES hit ExecutionHandler.handle
The client-side code on the STATIC page DOES NOT hit ExecutionHandler.handle -
7. Re: Client-side Seam remoting calls from a static web page o
art_jones76 Aug 2, 2007 5:08 PM (in response to art_jones76)Figured it out. samdoyle is correct. You can't make "cross-domain" calls. The definitions of acceptable and unacceptable differences in "domain" can be found here. (e.g. in Firefox, even different port numbers are unacceptable).
http://www.mozilla.org/projects/security/components/jssec.html
More useful info on working around this issue by Using a Web Proxy for Cross-Domain XMLHttpRequest Calls
http://developer.yahoo.com/javascript/howto-proxy.html
Thanks everyone for all your help!