I am using eclipse, Java, and seting up Ajax-DWR. When I run my program nothing happens. I belive This is cause by warning in my xml file. I tried looking on google but didn't found any thing.

files Path, jar files, etc...:

Take a look at the attached image.

Johe2.png

I am getting a following warning / error in DWR.XML File:

The file cannot be validated as the host "www.getahead.ltd.uk" is currently unreachable.

DWR.XML

<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN"
    "http://www.getahead.ltd.uk/dwr/dwr20.dtd">
<dwr>
  <allow>
    <create creator="new" javascript="ex01">
      <param name="class" value="DWR.ex01"/>
    </create>
  </allow>
</dwr>

ex01.HTML File

<html>
<head>
  <script type="text/javascript" src="dwr/interface/ex01Script.js"></script>
  <script type="text/javascript" src="dwr/engine.js"></script>
  <script type="text/javascript" src="dwr/util.js"></script>
  <script type="text/javascript" src="ex01.js"></script>
</head>
<body>
  <p> Name: <input type="text" id="demoName"/>
  <input value="Send" type="button" onclick="update()"/> <br/>
  Reply: <span id="demoReply"></span> </p>
</body>
</html>

ex01.JAVA File

package DWR;

public class ex01 {
public String sayHello(String name) {
    return "Hello, " + name;
    }
}

ex01.JS File

    function update() {
        name = dwr.util.getValue("demoName");

        ex01Script.sayHello(name, updateData);
    }

    function updateData(data) {
        dwr.util.setValue("demoReply", data);
    }

It's probbaly unreachable becuase it doesn't exist... .ltd.uk does not look like a normal UK URL. They normally end with .co.uk

This article has been dead for over six months. Start a new discussion instead.