This isn't really an App Engine question. Can you direct your question here?

http://groups.google.com/group/google-gson

--
Ikai Lan
Developer Programs Engineer, Google App Engine
Blogger: http://googleappengine.blogspot.com
Reddit: http://www.reddit.com/r/appengine
Twitter: http://twitter.com/app_engine



On Tue, Nov 30, 2010 at 11:12 AM, Valter <valter....@gmail.com> wrote:

> Hi, i have a servlet in GAE :
>
>     public void doGet(HttpServletRequest req, HttpServletResponse res)
> throws IOException {
>
>         String titulo = req.getParameter("titulo");
>         String json = "";
>
>         PersistenceManager pm = PMF.get().getPersistenceManager();
>         Query query = pm.newQuery("select from "+Video.class.getName()+ "
> where titulo.startsWith('"+titulo+"')");
>         List<Video> video = (List<Video>) pm.newQuery(query).execute();
>
>         Gson gson = new Gson();
>
>         json = gson.toJson(video, new
> TypeToken<List<Video>>(){}.getType());
>         System.out.println("SERIALIZED >> " + json);
>
>         res.setContentType("application/json");
>         res.setCharacterEncoding("UTF-8");
>         res.getWriter().write(json);
>
>     }
>
> So i'm trying to deserialize with GSON too :
>
>     public void receberMetaDados(String titulo) throws IOException,
> Exception{
>         InputStream input = new URL("http://localhost:8888/serve?titulo=
> "+titulo).openStream();
>         Reader reader = new InputStreamReader(input, "UTF-8");
>
>         List<Video> results = new Gson().fromJson(reader, new
> TypeToken<List<Video>>(){}.getType());
>
>     }
>
> But isn't working, any help ?
>
> Best regards,
> Valter Henrique.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com<google-appengine%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to