Hi Dale,
 
    Tried all the changes which you mentioned like keeping only 'json-default' 
and removing 'json' from result type but facing same problem...
 
   In struts.properties file having below line        
        struts.enable.DynamicMethodInvocation = true
 
  I'm using 'struts2-dojo-plugin-2.1.8.1.jar' plugin for doing AJAX, and you 
mentioned that dojo is deprecated.  Can you please tell me how to do AJAX in 
struts2.1.8?? what components(similar to dojo) we need to use to get AJAX 
functionality.
 
  Thanks for your help.
 
Regards,
Sharath.
   

--- On Tue, 4/20/10, Dale Newfield <d...@newfield.org> wrote:


From: Dale Newfield <d...@newfield.org>
Subject: Re: Using json in Struts 2.1.8.1
To: "Struts Users Mailing List" <user@struts.apache.org>
Date: Tuesday, April 20, 2010, 12:28 PM


On 4/20/10 11:34 AM, sharath karnati wrote:
> <package name="admin" extends="struts-default,json-default">
> <result-types>
>         <result-type name="json" class="org.apache.struts2.json.JSONResult" />
> </result-types>

json-default extends struts-default, so no reason do list both (and I don't 
even know if that works).
json-default defines the result type json, so no reason to redefine it again.

> <action name="Autocomplete!*" class="gov.admin.action.ManageAction" 
> method="{1}">
>            <result type="json"><param name="root">json</param></result>
> 
> </action>

I don't know if action names can include "!".  Do you have 
struts.enable.DynamicMethodInvocation set to false and you're trying to emulate 
that behavior here?

> <input dojoType="struts:ComboBox"
> dataUrl="/admin/Autocomplete!getNames.action" id="manageForm_"
> keyName="nullKey" loadOnType="true" loadMinimum="3"
> visibleDownArrow="true" />
> <script language="JavaScript"
> type="text/javascript">djConfig.searchIds.push("manageForm_");</script>

> after entering 3 or more characters it supposed to invoke 'getNames' method 
> but it is not even starting invocation of this method....

Sounds like you're having problems not with json but with dojo.  Note, the dojo 
plugin is old and deprecated.  I cannot help there.  Javascript errors on your 
page might be preventing other javascript from running. For debugging js I'd 
suggest the firebug plugin to firefox.

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




      

Reply via email to