views:

244

answers:

1

I'm using jqGrid for a table input and setting up the url as a servlet which will deal with the GET and POST requests and save the rows to a Java object.

I'm using webwork web framework and I was wondering how I can get access to the object that the servlet is saving the data to.

One way I have thought of is to just call the GET method from the Java action class which the servlet will return a JSON string with the object data.

Is there a better design for doing this?

This is probably not too clear so ask questions so I can help get across my point.

Thanks

A: 

Since you are using WebWork, why are you writing a Servlet? The jqGrid can post data to an action directly. Let the action do the work that the servlet is doing.

Vincent Ramdhanie
yeah I was going to do that but then I read somewhere it would be better to use a servlet so there's no overhead of using the webwork action system.I've ended up not bothering with the servlet and just using a dummy url for jqGrid, and posting all the rowdata at once in a hidden input when the user wants to create the records.Thanks for the reply anyway
Sam
@Sam In the vast majority of cases the overhead of the framework is completely justified by the benefits of using the framework. After you do your performance analysis you can decide if your situation calls for optimization but I suspect that it doesn't.
Vincent Ramdhanie