Wednesday, April 12, 2023

Re: Jakarta EE 9 support in GWT

Thanks very much Colin. I will post on that Git discussion.

On Thursday, April 6, 2023 at 10:19:03 PM UTC+10 Colin Alworth wrote:
The work on this topic is being discussed on that ticket and related pull requests. In short, if there is community support to implement and test this, it will be present in a future release.

Please try the test builds already discussed there, and consider joining the discussion to help contribute to the work.

On Monday, April 3, 2023 at 2:44:48 AM UTC-5 mickn...@gmail.com wrote:
Hi,

I'm working on a large Java library that utilizes both Spring and GWT. We want to move to Spring 6 as soon as possible but currently cannot do this because GWT 2.10 uses javax instead of jakarta.

Some work towards supporting jakarta has been discussed here - https://github.com/gwtproject/gwt/issues/9727.

Are there any intentions to support Jakarta in an upcoming GWT release?

Thanks,
Mike.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/f42f9342-4936-4f4a-b68f-f1ade677fe85n%40googlegroups.com.

Tuesday, April 11, 2023

Re: Privacy Violation with SSN

I haven't seen this come up before in a scan like this, thanks for sharing!

This is due to the compiler, but rather than obfuscation, this is due to the compiler solving for a constant value rather than doing the math at runtime. This same constant appears in the GWT showcase as well, at https://samples.gwtproject.org/samples/Showcase/Showcase.html in the https://samples.gwtproject.org/samples/Showcase/showcase/deferredjs/5F20F7F6874DB82B437E6EA4319E4E9B/47.cache.js file.

function Hmc(a,b,c,d,e,f){Gmc();this.a=e;Th(a,Dwc(b,c,d,e,f));a.db==-1?(Sbc(),Idc(a.hb,133333119|(a.hb.__eventBits||0))):(a.db|=133333119)}

This is slightly different from yours, and not just in the obfuscation - I suspect that you have emulated stack traces enabled, which should allow you to check the value of the NWl and RWk constants to confirm - they should be the "stack trace element" information, like class+method name, line number etc.

In this case, that particular line comes from Image.java's constructor. That calls the constructor of the inner class UnclippedState, which has these lines:
    UnclippedState(Image image) {
      image.replaceElement(Document.get().createImageElement());
      // We are working around an IE race condition that can make the image
      // incorrectly cache itself if the load event is assigned at the same time
      // as the image is added to the dom.
      Event.sinkEvents(image.getElement(), Event.ONLOAD);


      // Todo(ecc) this could be more efficient overall.
      image.sinkEvents(Event.ONCLICK | Event.ONDBLCLICK | Event.MOUSEEVENTS | Event.ONLOAD
          | Event.ONERROR | Event.ONMOUSEWHEEL | Event.TOUCHEVENTS | Event.GESTUREEVENTS);
    }

That chained | expression results in the number you're seeing. Then, that value is passed to Widget.sinkEvents(), which looks like this:
  @Override
  public void sinkEvents(int eventBitsToAdd) {
    if (isOrWasAttached()) {
      super.sinkEvents(eventBitsToAdd);
    } else {
      eventsToSink |= eventBitsToAdd;
    }
  }


The isOrWasAttached() call is a comparison of a field to -1, and a ternary is used instead of an if/else for this:
a.db==-1 ?
    (Sbc(),Idc(a.hb,133333119|(a.hb.__eventBits||0))):
    (a.db|=133333119)

Now it becomes clear that "this.eventsToSink" is "a.db", and "eventBitsToAdd" is the constant int 133333119.

Links to github source to confirm:
https://github.com/gwtproject/gwt/blob/1671fc2730e23b371962f482830c090b901ea54e/user/src/com/google/gwt/user/client/ui/Image.java#L371-L381
https://github.com/gwtproject/gwt/blob/1671fc2730e23b371962f482830c090b901ea54e/user/src/com/google/gwt/user/client/ui/Widget.java#L238-L245

So - this is not a SSN, but just happens to have the same number of digits.
On Tuesday, April 11, 2023 at 1:35:58 PM UTC-5 cyclop...@gmail.com wrote:
We hava a GWT project, and user use WebInspect to scan, then they found a critial issue as below in the file 30.cache.js
Snap10.jpg
ssn.png

What's the "133333119" ?
Is that bacause GWT obfuscate ?
Sorry we don't have the source codes of this GWT project (We just have WAR file only)

Many thx.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/562db861-68c1-43d8-81fa-65ac79d00681n%40googlegroups.com.

Re: page navigation

It is difficult to be sure what you are asking, but to navigate automatically to a new URL, you might just want Window.Location..assign(newUrl) or Window.Location.replace(newUrl), depending on exactly what behavior you want to have in your user's browser history. Alternatively if you are using activities/places or history tokens, you should use that specific api to send the user to the correct view.

On Tuesday, April 11, 2023 at 1:35:58 PM UTC-5 KEERTHIKA C wrote:
after creating the login page on the succesfull login the page has to locate to the another page in gwt give me some sample

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/e133af6b-0013-4c56-97f7-1232862b3914n%40googlegroups.com.

page navigation

after creating the login page on the succesfull login the page has to locate to the another page in gwt give me some sample

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/65713ea3-a655-4c39-8e81-050878e12084n%40googlegroups.com.

Monday, April 10, 2023

Privacy Violation with SSN

We hava a GWT project, and user use WebInspect to scan, then they found a critial issue as below in the file 30.cache.js
Snap10.jpg
ssn.png

What's the "133333119" ?
Is that bacause GWT obfuscate ?
Sorry we don't have the source codes of this GWT project (We just have WAR file only)

Many thx.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/a448956e-9ef7-4060-817f-28657284323fn%40googlegroups.com.

Thursday, April 6, 2023

Re: Jakarta EE 9 support in GWT

The work on this topic is being discussed on that ticket and related pull requests. In short, if there is community support to implement and test this, it will be present in a future release.

Please try the test builds already discussed there, and consider joining the discussion to help contribute to the work.

On Monday, April 3, 2023 at 2:44:48 AM UTC-5 mickn...@gmail.com wrote:
Hi,

I'm working on a large Java library that utilizes both Spring and GWT. We want to move to Spring 6 as soon as possible but currently cannot do this because GWT 2.10 uses javax instead of jakarta.

Some work towards supporting jakarta has been discussed here - https://github.com/gwtproject/gwt/issues/9727.

Are there any intentions to support Jakarta in an upcoming GWT release?

Thanks,
Mike.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/11047a56-f8ef-40ee-8896-633facf10153n%40googlegroups.com.

Re: Question about setting GWT RPC timeout

What you're looking for is a way to re-try requests in the case where the server is unreachable, which is not something that HTTP or the browser gives you automatically. If you had a proxy, but the server itself was down, the proxy would likely return a 503 service unavailable status, which the client could use to retry until the service was available (which might only happen for a certain number of seconds or a certain number of tries). It might also be possible for a proxy to wait and retry the upstream server until it was available, but I can't think of a proxy right now with that feature.

HTTP itself doesn't have a timeout feature at all either. The timeout that you're setting on the client side is a simple GWT Timer, if the request hasn't finished (either in success or failure), it cancels the upstream request and presents the failure you're seeing to the client.

Be a little careful when implementing a retry mechanism, as it is possible that the call made it to the server, and the server performed the action, but the client lost internet connection while the response was on its way to the client - that is, retrying a non-idempotent or expensive action may cause problems you weren't expecting. A status code of 0 is usually the client's way of saying "I wasn't able to get any reply from the server for some reason" - taking that information and trying to do something simple and idempotent until a server connection can be reestablished lets you know that the server and network are both working again, followed by some "did my last action succeed" before trying again (or just let the user dismiss the message and try again) will help mitigate this class of issues. A proxy sending back a 503 is a safer way to be sure that the network connection is good, but only the server is down, so you can retry - but be aware that technically there might be a network issue between the proxy and server, though this is much less likely.

Good luck,
Colin

On Thursday, April 6, 2023 at 7:05:53 AM UTC-5 Dmitri wrote:
Dear Colin

Thank you so much for your advice. I'll take a closer look at those areas.

Just a little clarification: The server is not running at all. Both exceptions are generated from the client only with different timeout settings when it cannot reach the server.
When the server is running - no problems in both cases. The purpose of the code is to make the client wait longer when the server is unreachable due to temporary communication problems.

PS there are some typos in the codes I provide which I made when clean-up for posting., Please ignore them.
Thank you again

Best regards
Dmitri


On Thu, Apr 6, 2023 at 9:49 PM Colin Alworth <nilo...@gmail.com> wrote:
I believe you're experiencing different timeouts in different cases. That is, the problem you're facing of a short timeout before you use your RPC_TIMEOUT_MS is a server-side timeout (or potentially a proxy?), but after you set a client-side timeout, the client is observing that the server is taking too long, and terminating the call from its side, resulting in the RequestTimeoutException.

To confirm this, try setting the client-side timeout to something like one minute, 60_000, and see that the error returns to the old message you were seeing. A timeout set like this does not guarantee that the server stops processing the request, only that the client stops waiting for it, and it may not be appropriate for your use case at all.

With the client-side timeout set to a reasonable amount or entirely removed, take a closer look at the error message you're getting from the server, and any server or proxy logs you're getting. If there is a proxy, see if you can connect directly to the server to rule out the proxy setting this short timeout. Very likely this is a configuration on the server/proxy that can be change to suit your requirements.

On Thursday, April 6, 2023 at 2:26:31 AM UTC-5 Dmitri wrote:
Dear gurus,

I'm learning Java and GWT and I'm facing a problem with setting timeout for PRC calls. I want to extend the RPC timeout before the client reports a failure. The code I'm using is attached below.

I'm running a client in firefox and experience the following problem:

I want to achieve a timeout of 20-30 seconds. However I can set the timeout (RPC_TIMEOUT_MS) only up to 3200mS. In case the server does not respond I receive the exception "com.google.gwt.http.client.RequestTimeoutException: A request timeout has expired after 3200 ms" accurately after defined time.

However in case set timeout exceeds the 3300ms of above the exception is different "com.google.gwt.user.client.rpc.StatusCodeException: 0" and is thrown always after 3-4 seconds.

What causes this exception and how can I extend the waiting time?

Thank you,
Best regards
Dmitri

The code:
public class MyClass implements EntryPoint {

  private static final int RPC_TIMEOUT_MS = 3300;

  private static class TimeoutRequestBuilder extends RpcRequestBuilder {
    @Override
    protected RequestBuilder doCreate(String serviceEntryPoint) {
  RequestBuilder builder = super.doCreate(serviceEntryPoint);
      builder.setTimeoutMillis(RPC_TIMEOUT_MS);
      return builder;
    }
  }

  private static final RpcRequestBuilder requestBuilder = new TimeoutRequestBuilder();
  private final HubServiceAsync myService = GWT.create(HubService.class);

  @Override
  public void onModuleLoad() {
    ((ServiceDefTarget) hmyService).setRpcRequestBuilder(requestBuilder);

    final MainView mainView = new MainView(hubService);

    RootPanel rootPanel = RootPanel.get();
    rootPanel.add(mainView);

    Window.addResizeHandler(new ResizeHandler() {
      @Override
      public void onResize(ResizeEvent event) {
        mainView.resize();
      }
    });
  }
}


--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/76443417-083f-4401-94f5-cd9fd392f80fn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/f58806df-5f66-4309-a925-caca309fb668n%40googlegroups.com.