Giter Site home page Giter Site logo

Comments (13)

nmorel avatar nmorel commented on July 29, 2024

resty-gwt, you sure ?
Or GWTP Rest Dispatch ?

What type do you have instead of List ? And what is the json you are trying to deserialize ?

from gwt-jackson.

confile avatar confile commented on July 29, 2024

GWTP Rest Dispatch uses GWT-Jackson (this project)

from gwt-jackson.

doggie1989 avatar doggie1989 commented on July 29, 2024

resty-gwt 2.0.1
gwt-jackson 0.7.0

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

Hmm that's odd. I'm not aware of resty-gwt using gwt-jackson. I thought they add their own serializer.

Since your map is in the param, I guess the ClassCastException occurs in server side ? Do you have the json produced by GWT ? You can see it with the developers tools of Chrme for exemple.

from gwt-jackson.

doggie1989 avatar doggie1989 commented on July 29, 2024

ClassCastException occurs in client side.

server side : spring boot ,jackson 2
client side: restygwt.
in 2.0.1 version ,they use gwt-jackson...

from gwt-jackson.

doggie1989 avatar doggie1989 commented on July 29, 2024

{"id":"54980bc3d4c6583a12ffbfa6","sku":"aaaaaaa","mainPicUrl":"http://static.cheaplify.com.au/SH141111B001_0.jpg","name":"bbbbbbb","orderUrls":["fdsafdsafdsa","fdsafdsafdas"],"infoUrls":["fdsafdsafdsafas","fdsafdsafdsafdsa"],"cost":11.0,"notes":"","stockQty":12,"creationTime":1419250626478,"modificationTime":1419250701184,"type":"SUCCESS","message":"SUCCESS"}

Map<String,Object> response...
List orderUrls = (List)response.get("orderUrls"); // can not cast...

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

Can you try to cast into JSONArray ?

The last time I check, restygwt manipulates JSONValue.

from gwt-jackson.

doggie1989 avatar doggie1989 commented on July 29, 2024

Client:
still Uncaught java.lang.ClassCastException
JSONArray jsonArray = (JSONArray) whProduct.get("orderUrls");

Server side:
it is
List orderUrls;

from gwt-jackson.

doggie1989 avatar doggie1989 commented on July 29, 2024

Hi Nmorel

I double checked resty-gwt,it does not use gwt-jackson...

and i change method to ..

@Path("http://localhost:8081")
public interface WhService extends RestService {

  @POST
  @Path("/{methodUrl}")
  public void postRequest(@PathParam("methodUrl") String methodUrl,Map<String,Object> request,MethodCallback<JSONValue> callback);


}

JSONValue response = ...
Map<String, Object> responseMap = mapper.read(response.toString()); //use your project
 for (String orderUrl : (List<String>) responseMap.get("orderUrls")) {
      TextBox tbOrderUrl = new TextBox();
      tbOrderUrl.setText((String)orderUrl);
      vpOrderUrl.add(tbOrderUrl);
    }
    LogUtils.log("ok");

it works!

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

Nice :)

Maybe you can try GWTP Rest Dispatch, it should have the same functionalities as RestyGWT but uses gwt-jackson.

from gwt-jackson.

doggie1989 avatar doggie1989 commented on July 29, 2024

:)
Thank you for your project.
I will try rest dispatch soon.

from gwt-jackson.

reinert avatar reinert commented on July 29, 2024

As an alternative, you could try requestor. It is integrated to gwt-jackson too.

from gwt-jackson.

nmorel avatar nmorel commented on July 29, 2024

I'll add frameworks using gwt-jackson to the README

from gwt-jackson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.