Re: Webwork and DWR

James David <[email protected]> Fri, 29 Dec 2006 01:31:25 CST
Newsgroups gmane.comp.java.open-symphony.webwork
Message-ID <12067628.1167377596635.JavaMail.os-j2ee@opensymphony01.managed.contegix.com>
Hi Stefan -

Looks like you are able to make this work with DWR 2.0 version. I downloaded the DWR and tried to follow the steps to integrate and running into a road block here.

My jsp page code looks like this

[code]
<%@ page contentType="text/html" %>
<%@ taglib prefix="ww" uri="/webwork" %>

<html>
<head>
<title>My Page</title>
<link rel='stylesheet' type='text/css' href='./stylesheet/stylesheet.css'/>
<ww:head/>
</head>

<script src='dwr/engine.js'></script>
<script src='dwr/util.js'></script>
<script src='dwr/interface/DWRAction.js'></script>
<script src='DWRActionUtil.js'></script>

<script language="JavaScript" type="text/javascript">

	function doValidate() {
		DWRActionUtil.execute({
	  					namespace:'default',
  						action:'AddLink',
  						method:'validateData',
  						executeResult:'false'
						},'myform',done);
	}

	function done(data){
		alert('came here');
    }
</script>

[/code]

When i tried to submit the ajax action - i get a javascript error. The error is on line 83 in the DWRActionUtil.js...the line reads

[code]
 if (mustCall) {
    [b]DWRAction.execute(actionObj, params, callbackObj);[/b]
  }
[/code]

It complains there is no such property or method. If I look at the DWRAction.js file there is no such method "execute".

The dwr.xml file does have the execute method permission

[code]
<create creator="none" javascript="DWRAction">
		  <param name="class" value="org.directwebremoting.webwork.DWRAction"/>
		  <include method="execute"/>
		</create>
[/code]

I'm wondering if this is a bug.

If you have a working code - could you share the snippet. Trying to figure out where I'm wrong.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=45567&messageID=110964#110964