• 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

Passing variables to Java using Ajax DWR

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm picking up a project using Ajax an din specific DWR. I don't know too much about either though and seem to be stuck on something that hopefully seems easy to everyone else.

I am trying to pass a variable string from my JSP page to my java method. Although the examples on the DWR site work there, when I try seemingly the same code I get the same result on my site, a message popping up saying "Invalid reply from server"

my setup is this. I put the method class into the dwr.xml


A created the classes to pull from with 2 parameters


and I put the javascript in the page


where did I go wrong though? thanks for any help.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

and I put the javascript in the page


Does this mean that you included the /dwr/engine.js and /dwr/interface/Remote.js files?
If so, try going to your DWR test page (webappRootUrl/dwr) to see if it has created the Remote.js file.
Look to see if the Remote.js file that was created contains a function named "log" which takes two parameters. If not, you may need to add an <include> tag to your dwr.xml

I'm not a super proficient DWR user, but I've tinkered with it a bit. Paste your whole Java class, dwr.xml and html page and I can try and run it/debug it.
 
Sheriff
Posts: 67747
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

Gran Roguismo wrote:and I put the javascript in the page


Is this really what's on the page? If so, check your spelling. If not, please read AvoidRedHerrings.
 
Space pants. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic