File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes do not get JSON data back (using JSONPlugin) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "do not get JSON data back (using JSONPlugin)" Watch "do not get JSON data back (using JSONPlugin)" New topic
Author

do not get JSON data back (using JSONPlugin)

Manuel Oetzi
Greenhorn

Joined: Jun 23, 2011
Posts: 10
Hello,

I have problems with the JSONPlugin. I want to retrieve JSON from an Action but I only get back a comma seperated list.
So somehow the converting into JSON does not work. Unfortunately I cannot figure it out why...

Here are the relevant code snippets:

JSP (jQuery ajax call to get the data for the autocomplete function):


The ajax call itself works fine, but the first alert(msg) does not show the returned data in JSON format but as mentioned simply comma seperated.

struts.xml



What may go wrong here?

Greetings oetzi

EDIT: Although this is not a jQuery forum maybe anyone knows why
data: "productPart="+$(this).val(),
(within the ajax call) does not provide the expected value within my Action.
$(this).val() shows the expected value during an alert() and getter/setter for productPart are also available.
Manuel Oetzi
Greenhorn

Joined: Jun 23, 2011
Posts: 10
Has no one any idea?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: do not get JSON data back (using JSONPlugin)