[jboss-user] [JBoss Seam] - Re: External AJAX access to webremote?

whafrog do-not-reply at jboss.com
Thu Dec 13 14:43:13 EST 2007

"shane.bryzak at jboss.com" wrote : Oh, and you also need to override the Seam.Remoting.resourcePath after you import the script.  It defaults to "/appname/seam/resource/remoting", so you'll need to give it an absolute url also...

According to the Firefox javascript console, "Seam is not defined".  Here's my whole page, which is just a file on my drive (not deployed).  It's pointing to a deployed app:

  | <head>
  | <script type="text/javascript" src="http://localhost:8080/myapp/seam/resource/remoting/resource/remote.js"></script>
  | <script type="text/javascript" src="http://localhost:8080/myapp/seam/resource/remoting/interface.js?myservice"></script>
  | <script type="text/javascript">
  | 	function getStuff() {
  | 		alert(Seam.Remoting.resourcePath);
  | 		Seam.Remoting.resourcePath = "http://localhost:8080/myapp/seam/resource/remoting";
  | 		alert(Seam.Remoting.resourcePath);
  | 		Seam.Component.getInstance("myservice").getStuff("param1", "param2", getStuffCallback)
  | 		alert("called");
  | 	}
  | 	function getStuffCallback(result) {
  | 		alert(result);
  | 	}
  | </script>
  | </head>
  | <body>
  | Seam Remote Test:<br/>
  | <hr/>
  | <button onclick="javascript:getStuff()">Get Stuff</button>
  | </body>
  | </html>

I trust my web.xml file is set up properly:

  | 		<servlet-name>Seam Resource Servlet</servlet-name>
  | 		<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
  | 	</servlet>
  | 	<servlet-mapping>
  | 		<servlet-name>Seam Resource Servlet</servlet-name>
  | 		<url-pattern>/seam/resource/*</url-pattern>
  | 	</servlet-mapping>

Anything in there that might get in the way?  Security?

Thanks to dakna for the other thread, crossing domains may be an issue in future, but I'd like to prove it can work within-domain  :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112692#4112692

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112692

More information about the jboss-user mailing list