File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes DWR  Undefined Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "DWR  Undefined" Watch "DWR  Undefined" New topic

DWR Undefined

chetan raj
Ranch Hand

Joined: Jul 18, 2006
Posts: 34
I am trying to run the dwr sample example. gettting the following error dwr undefined.
I have places dwr.jar in my lib folder of the tomcat.
Can any body suggest where i am going wrong. Any link to dwr examples will be
really helpful

thanks in advance,
chetan raj

This is my code
function update() {
var name = dwr.util.getValue("demoName");
Demo1.sayHello(name, function(data) {
dwr.util.setValue("demoReply", data);
<script language="text/javascript" src="/js/engine.js"></script>
<script language="text/javascript" src="/js/util.js"></script>
<script language="text/javascript" src="/js/gi.js"></script>

<input type="text" id="demoName"/>
<input value="Send" type="button" onclick="update()"/>

Reply: <span id="demoReply"></span>

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



Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.

Also, since DWR has both server and client side components, it's more of a framework than a JavaScript library, so it's probably best to discuss it in the Frameworks forum. I've moved this post there for you (though to be honest, I do not know if there are many DWR devotees who frequent these forums).

[Asking smart questions] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Just where do you get this message? From JavaScript? From the Java compiler? Please tell the details!

Are you sure that your servlet mapping is correct? It looks suspect to me.
I agree. Here's the link:
subject: DWR Undefined
jQuery in Action, 3rd edition