I have something like that in the page :
$.getJSON("...",
function(json) {
if (json.result == "OK") {
...
} else {
...
}
});
And in the action I have this :
public String getResult() {
return this.result;
}
In my case it's a single String but I suppose you can return more
complex objects.
Cimballi
On Fri, Apr 30, 2010 at 2:51 PM, Ozu Natsu <[email protected]> wrote:
> I am having some problems with the call, the ajax "get" returns no
> response, even though I know the form validation should be failing.
> My ajax call looks like this:
>
>
> var url= "./checkValid.do";
> $.ajax({
> type : "GET",
> cache : false,
> dataType: "json",
> url url,
> data :
> $(this).serialize()+'&struts.enableJSONValidation=true&struts.validateOnly=true',
> success: function(data, textStatus, XMLHttpRequest) {
> // do something here
> alert(textStatus);
> }
> });
>
>
> My action looks like this:
> <action name="checkValid" class="actionclass">
> <result type="json">
> <param name="root">jsonData</param>
> </result>
> </action>
>
> Am I missing something?
--
Cimballi
JAVA J2EE Freelance
http://cimballi.elance.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]