This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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: 63548

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: 63548

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
It's not a secret anymore!