Link to home
Start Free TrialLog in
Avatar of anotherfn
anotherfn

asked on

DWR messaging issue

We are working on an HMTL5 project, and are connecting it to Java servlets on the back end. To connect the UI to the server code, we are using DWR.  We have set up our xml files for this, and stored them in the WEB-INF folder, and have the dwr.jar file in the WEB-INF/lib folder, as well as the commons-loggin.jar file.  This is our web.xml:

<servlet>
      <display-name>DWR Servlet</display-name>
      <servlet-name>dwr-invoker</servlet-name>  
      <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
      <init-param>
            <param-name>debug</param-name>
            <param-value>true</param-value>
      </init-param>
</servlet>

<servlet-mapping>
  <servlet-name>dwr-invoker</servlet-name>
  <url-pattern>/dwr/*</url-pattern>
</servlet-mapping>  

and this is our dwr.xml:

<!DOCTYPE dwr PUBLIC
      "-//GetAhead Limited//DTD Direct Wrb Remoting 3.0//EN"
      "http://getahead.org/dwr/dwr30.dtd">
      
<dwr>
      <allow>  
            <create creator ="new" javascript="ClassFile">
                  <param name = "class" value = "our.Folder.Path.ClassFile"/>
            </create>
      </allow>
</dwr>

and this is how we are calling it in our html code:

<script type="text/javascript" src = "jquery-1.7.2.js"></script>
<script>var pathToDwrServlet = "http://xxx.xxx.xxx.xxx:port/blazeds/dwr";</script>
<script type="text/javascript" src="http://xxx.xxx.xxx.xxx:port/blazeds/dwr/engine.js"></script>
<script type="text/javascript" src="http://xxx.xxx.xxx.xxx:port/blazeds/dwr/interface/ClassFile.js"></script>

Server._path = 'http://217.174.241.115:8400/blazeds/dwr';
      Server.getNewPlayerRequest({
            callback:function(str){
                        //do our code here
            }
      });
});

The code we have set to run does not function, so it doesn't seem as though the front end is connecting to the backend, what can we change to make it work?
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial