views:

79

answers:

2

I have the following jqGrid script:

   jQuery("#editgrid").jqGrid({        
       url: "editing.php?q=1",
       datatype: "xml",
       // ...

Where should the url point to if I am using Java instead PHP for creating the crud?

+3  A: 

It should just point to an URL where you've some Java code running and listening on the particular URL. In a Java webapplication you normally use a Servlet class for this. Just let the URL match the <url-pattern> of the Servlet class as you've definied in the web.xml. In the Servlet class you just implement doGet() method accordingly to handle the HTTP GET request and response.

BalusC
I am not using servlet for my program. Because i am using DWR here.So do i need to call the remote method here.? How to make this jquery to call my edit funtion in the place of that URL.??
Code 'N' Weed
Just let it point to DWR URL then.
BalusC
A: 

If you're using DWR, specify a function as your datatype (instead of "xml") that calls the DWR Javascript method. The DWR function's callback should then call the editGrid's addXMLData like so:

$("#editGrid")[0].addXMLData(xmlData)

note the [0] notation, which is neccesary. Details here: JQGrid Wiki: methods

Jake