Wednesday, October 3, 2012

Re: GWT WebApp and iOS 6 Safari

Hi Jens,
thanks for hints.

I tried to compile the app in DETAILED, PRETTY and OBFUSCATED mode but the problem is still occurring.
With Safari 6 on OSX it's working good.
I already tried to introduce no-arg constructor of RegisterPlace with setters methods and using them in Tokenizer.getPlace() method: still having the exception.

I succeded to replicate the problem using IOS 6 emulator (on IOS 5 emulator it's working good). And the problem seems to occur always when I try to access directly to any history mapped places of my app (so not only with the RegisterPlace).

I enabled IOS 6 Safari web inspector but I don't know why, when I replicate the problem (emulator or iphone), Safari console on my Mac doesn't help at all (it's showing the current session but not showing errors, javascripts debugging and log console). I succeded to debug what was happening (ClassCastException) using simple Window.alert messages.

Alert message on Exception is: "Exception: message=null, toString=java.lang.ClassException"
Did you know a way to gather more info about raised exception?


    @Prefix("register")
    public static class Tokenizer implements PlaceTokenizer<RegisterPlace> {

        @Override
        public String getToken(RegisterPlace place) {
            return place.getEmail() + SEPARATOR + place.getCode();
        }

        @Override
        public RegisterPlace getPlace(String token) {
            Window.alert("register place tokenizer getPlace with token=" + token);
            String bits[] = token.split(SEPARATOR);
            if (bits.length == 2) {
                Window.alert("received tokens: bits[0]=" + bits[0] + ", bits[1]=" + bits[1]);
                String email = bits[0];
                String code = bits[1];
                RegisterPlace place = null;
                try {
                    place = new RegisterPlace();
                } catch (Exception ex) {
                    Window.alert("Exception: message=" + ex.getMessage() + ", toString=" + ex.toString());
                }
                place.setEmail(email);
                place.setCode(code);
                return place;
            } else {
                return new RegisterPlace(null,null);
            }
        }
    }



--
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/-/p4ShmL87IgUJ.
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