The moose likes HTML, CSS and JavaScript and the fly likes Passing variables to Java using Ajax DWR Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Passing variables to Java using Ajax DWR" Watch "Passing variables to Java using Ajax DWR" New topic
Author

Passing variables to Java using Ajax DWR

Gran Roguismo
Ranch Hand

Joined: Mar 10, 2005
Posts: 77
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.


EOL
B Stapleton
Greenhorn

Joined: Sep 07, 2010
Posts: 1
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.
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48842

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
 
subject: Passing variables to Java using Ajax DWR
 
developer file tools