Thursday, June 7, 2012

Re: How to send hashmap with a file using Servlet in GWT

On Thursday, June 7, 2012 5:01:10 AM UTC-4, learning coding wrote:
Hi,
thanks for you reply.
Do you think its agood practice to mix JSON with AJAX.
I made my AJAX front End in the JAVA programming Language.
and also my back end is also Java. 

Someone else will have to answer that for you. I'm using GWT RPC almost exclusively. When I use JSON it's as I described--send a JSONObject as a string, parse it back to a JSONObject, and process. There are places in my project that it's the handiest format available.
 
On Jun 6, 9:23 pm, Thad <thad.humphr...@gmail.com> wrote:
> On Wednesday, June 6, 2012 9:47:32 AM UTC-4, learning coding wrote:
>
> > I want to know or some code sample which will help me to send the file
> > and the hashmap to the server.
>
> > To upload a file to GWt server i use formpanel and a HttpServlet. this
> > is working fine.
>
> > i have a hashmap
>
> >     private static Map<String, List<Customproperties>> docClass =
> >  new HashMap<String, List<Customproperties>>();
>
> > which holds the property of document according to its classname.
>
> > I know how to do with RPC to send hashMap. but i want to do with
> > servlet.As i have to upload a file which i have done with servlet. And
> > every Hashmap is related to file .and this file with its property(in
> > HashMap) will send to external repository.
>
> > Please help.
>
> First thought: Convert the map to an com.google.gwt.json.client.JSONObject
> on the client and send that as a String via POST to the servlet. On the
> server side turn that string into an org.json.JSONObject (http://www.json.org/) and from that recreate the map.- Hide quoted text -
>
> - Show quoted text -

On Thursday, June 7, 2012 5:01:10 AM UTC-4, learning coding wrote:
Hi,
thanks for you reply.
Do you think its agood practice to mix JSON with AJAX.
I made my AJAX front End in the JAVA programming Language.
and also my back end is also Java.


On Jun 6, 9:23 pm, Thad <thad.humphr...@gmail.com> wrote:
> On Wednesday, June 6, 2012 9:47:32 AM UTC-4, learning coding wrote:
>
> > I want to know or some code sample which will help me to send the file
> > and the hashmap to the server.
>
> > To upload a file to GWt server i use formpanel and a HttpServlet. this
> > is working fine.
>
> > i have a hashmap
>
> >     private static Map<String, List<Customproperties>> docClass =
> >  new HashMap<String, List<Customproperties>>();
>
> > which holds the property of document according to its classname.
>
> > I know how to do with RPC to send hashMap. but i want to do with
> > servlet.As i have to upload a file which i have done with servlet. And
> > every Hashmap is related to file .and this file with its property(in
> > HashMap) will send to external repository.
>
> > Please help.
>
> First thought: Convert the map to an com.google.gwt.json.client.JSONObject
> on the client and send that as a String via POST to the servlet. On the
> server side turn that string into an org.json.JSONObject (http://www.json.org/) and from that recreate the map.- Hide quoted text -
>
> - Show quoted text -

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/OOeWPvH-fbkJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment