At 3:29 PM -0600 12/5/05, Sonali Kulkarni wrote:
 I am trying to use Ajax (DWR framework) within Struts Framework.
Per DWR Documentation, they have added StrutsCreator in current version to
support struts framework. I just do not know how to use / integrate it. I am
new to AJAX. Can anyone please help me out.

When I try to make a dwr call on jsp, I get javascript error [object error]
and on the console I can see error -
uk.ltd.getahead.dwr.util.CommonsLoggingOutput error SEVERE: No converter
found for org.apache.struts.action.ActionServletWrapper .


You probably don't actually want to be sending or receiving the ActionServletWrapper in your remote calls, so you probably want to take a step back and assess your remote object's API.

You might also want to review the DWR documentation on Converters:
http://getahead.ltd.uk/dwr/server/dwrxml/converters

In short, it requires you to show it how to marshall any object except a few core types to and from JavaScript, so that it knows which properties to expose and which to protect.

Joe



Please help!
---------------------------------------------------------------------------
My dwr.xml -

<!DOCTYPE dwr PUBLIC
    "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
    "http://www.getahead.ltd.uk/dwr/dwr10.dtd";>

<dwr>
  <init>
    <creator id="struts" class="uk.ltd.getahead.dwr.create.StrutsCreator"/>
  </init>

  <allow>
    <create creator="struts" javascript="BatchTransDetailActFrm">
      <param name="formBean" value="BatchTransDetailActFrm"/>
           <include method="addTransaction"/>
    </create>

  </allow>
</dwr>
---------------------------------------------------------------------------

My Javascript from JSP -

    <script language="javascript1.2" src="<sys:write propertyName='
apache.root.alias'/>/dwr/interface/BatchTransDetailActFrm.js"></script>
    <script language="javascript1.2 " src="<sys:write propertyName='
apache.root.alias'/>/dwr/engine.js"></script>
    <script language=" javascript1.2" src="<sys:write propertyName='
apache.root.alias'/>/dwr/util.js"></script>


 <!-- This is how we access javascript and css otherwise -->
    <script language="javascript1.2" src="<system:getServer propertyName='
apache.base.name '/>/javascript/Validation.js"></script>
    <link href="<system:getServer
propertyName='apache.base.name'/>/stylesheet/greatvic.css"
rel="stylesheet" type="text/css">
    <script>

function addTrans(){
var acctType= document.getElementById("acctType").value;
var acctNum= document.getElementById("acctNum").value;
var vletters= document.getElementById("vletters").value;
var suffix= document.getElementById("suffix").value;
var amount= document.getElementById("amount").value;
var checkType= document.getElementById("checkType").value;
BatchTransDetailActFrm.addTransaction (fillTable, acctType, acctNum,
vletters, suffix, checkType,amount); $("resultTable").style.display = '';
}

function fillTable(transactionBeans) {
DWRUtil.addRows("transactionbody", transactionBeans, [ getBatchNum,
getAcctType, getAcctNum, getVletters, getSuffix, getCheckType, getAmount ]);

}

---------------------------------------------------------------------------
When I make call to addTrans function I get "[Object Error]" javascript
popup. And on server I see Error -
uk.ltd.getahead.dwr.util.CommonsLoggingOutput error SEVERE: No converter
found for org.apache.struts.action.ActionServletWrapper.
------------------------------ ---------------------------------------------

Also while loading that jsp page initially on the server I see error  -

Dec 5, 2005 2:37:49 PM uk.ltd.getahead.dwr.util.CommonsLoggingOutput error
SEVERE: Error loading class for creator
'StrutsCreator[BatchTransDetailActFrm]'.

java.lang.NullPointerException
        at org.apache.struts.util.ModuleUtils.getModuleConfig(
ModuleUtils.java:76)
        at org.apache.struts.util.ModuleUtils.getModuleConfig(
ModuleUtils.java:127)
        at org.apache.struts.util.RequestUtils.getModuleConfig(
RequestUtils.java:1110)

Can someone please guide whats going wrong? I am new to DWR.. and I am
stuck!
---------------------------------------------------------------------------


--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex

Reply via email to