• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DWR Undefined

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
------------------------------------------------------------------------------------------

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic