• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DWR Undefined

 
chetan raj
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Demo.jsp
<html>
<head>
<script>
function update() {
var name = dwr.util.getValue("demoName");
Demo1.sayHello(name, function(data) {
dwr.util.setValue("demoReply", data);
});
}
</script>
</head>
<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>


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


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



______________________________________________________________
Demo1.java
public class Demo1{
public String sayHello(String name) {
return "Hello, " + name;
}
}
___________________________________________________________________
web.xml

<web-app>
<servlet>
<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>/dw/*</url-pattern>
</servlet-mapping>

</web-app>
------------------------------------------------------------------------------------------

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic