Tuesday, August 29, 2017

Re: Weird behavior from JsInterop for uninitialized fields/attributes.

makes sens. 

I have noticed that if it is explicitly set to null then it will be set to null in Js as well, once again it gets translated to Js :)  

Thanks for the clear cut explanation!


Le mardi 29 août 2017 13:16:45 UTC+2, Thomas Broyer a écrit :


On Tuesday, August 29, 2017 at 12:36:11 PM UTC+2, zakaria amine wrote:
Hello, 

This is a minor remark, and it does affect the functioning of JsInterop, as far as I experienced, but may be worth looking into by GWT folks. I have the following Js object that I am wrapping in Java:

var Hotel = function() {
 
this.guests = [];
};


Hotel.prototype = {
 addGuest
: function(guest) {
 
this.guests.push(guest);
 
},
 getGuestCount
: function(){
 
return this.guests.length;
 
}
}


@JsType(isNative=true, namespace=GLOBAL)
public class Hotel {
 
@JsMethod
 
public native final int getGuestCount();
 
 
@JsMethod
 
public native final void addGuest(Guest guest);
}

I pass a Guest object to the addGuest Method

@JsType(isNative=true, namespace=GLOBAL, name="Object")
public class Guest {
 
 
public int guestId;


 
public String firstName;


 
public String lastName;
 
 
public String roomNumber;
}


public class Test implements EntryPoint {


 
String uninitializedString;
 
 
public void onModuleLoad() {


   
Hotel hotel = new Hotel();


   
Guest guest = new Guest();
     guest
.firstName= "test";
   
//passed object is guest = {firstName: "test"}
     hotel
.addGuest(guest);


   
Guest guest2 = new Guest();
    guest2
.firstName = "test";
    guest2
.lastName = uninitializedString;
   
//passed object is guest = {firstName: "test", lastName: undefined}, should also be guest = {firstName: "test"}
    hotel
.addGuest(guest2);
}

}


In short, if you are assigning an uninitialized variable to an uninitialized Object field, the field will not be ignored anymore by JsInterop, and will be transpiled as undefined, although it is still uninitialized. This happens often with the builder pattern.

Let's translate your code to JS manually:

let uninitializedString;

function onModuleLoad() {
  let hotel = new Hotel();

  let guest = new Object(); // because you used name="Object"; at that point, guest is {}
  guest.firstName = "test";
  hotel.addGuest(guest);

  let guest2 = new Object();
  guest2.firstName = "test";
  guest2.lastName = unitializedString;
  hotel.addGuest(guest2);
}

See? your property assignments are creating the properties on a bare JS Object, and assigning 'undefined' will still create the property.

Also keep in mind that what you declare in your native types are only mapping about how to use/call the JS API, not necessarily what it actually is under the hood; i.e. just because you use a field does not mean that it's actually a "simple" JS property: it could have been defined with a setter, so guest2.lastName=undefined might actually have a side-effect other than creating a property (that's exactly that kind of property that's declared when you use getter/setter methods for a @JsProperty in a non-native type); and conversely, you could use getter/setter methods for a @JsProperty in a native type, that's a "simple" property in JS.

BTW, the 'undefined' here is seen by GWT as a Java 'null', but it won't bother initializing the field with 'null' as it treats 'undefined' and 'null' as equivalent (to a Java 'null'); this is an optimization technique (saves a few bytes in generated payload, and CPU cycles at runtime) that IIRC was added at some point in the GWT 2 lifecycle; earlier versions would explicitly initialize the uninitializedString field to null in the Test constructor/initializer.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: Weird behavior from JsInterop for uninitialized fields/attributes.



On Tuesday, August 29, 2017 at 12:36:11 PM UTC+2, zakaria amine wrote:
Hello, 

This is a minor remark, and it does affect the functioning of JsInterop, as far as I experienced, but may be worth looking into by GWT folks. I have the following Js object that I am wrapping in Java:

var Hotel = function() {
 
this.guests = [];
};


Hotel.prototype = {
 addGuest
: function(guest) {
 
this.guests.push(guest);
 
},
 getGuestCount
: function(){
 
return this.guests.length;
 
}
}


@JsType(isNative=true, namespace=GLOBAL)
public class Hotel {
 
@JsMethod
 
public native final int getGuestCount();
 
 
@JsMethod
 
public native final void addGuest(Guest guest);
}

I pass a Guest object to the addGuest Method

@JsType(isNative=true, namespace=GLOBAL, name="Object")
public class Guest {
 
 
public int guestId;


 
public String firstName;


 
public String lastName;
 
 
public String roomNumber;
}


public class Test implements EntryPoint {


 
String uninitializedString;
 
 
public void onModuleLoad() {


   
Hotel hotel = new Hotel();


   
Guest guest = new Guest();
     guest
.firstName= "test";
   
//passed object is guest = {firstName: "test"}
     hotel
.addGuest(guest);


   
Guest guest2 = new Guest();
    guest2
.firstName = "test";
    guest2
.lastName = uninitializedString;
   
//passed object is guest = {firstName: "test", lastName: undefined}, should also be guest = {firstName: "test"}
    hotel
.addGuest(guest2);
}

}


In short, if you are assigning an uninitialized variable to an uninitialized Object field, the field will not be ignored anymore by JsInterop, and will be transpiled as undefined, although it is still uninitialized. This happens often with the builder pattern.

Let's translate your code to JS manually:

let uninitializedString;

function onModuleLoad() {
  let hotel = new Hotel();

  let guest = new Object(); // because you used name="Object"; at that point, guest is {}
  guest.firstName = "test";
  hotel.addGuest(guest);

  let guest2 = new Object();
  guest2.firstName = "test";
  guest2.lastName = unitializedString;
  hotel.addGuest(guest2);
}

See? your property assignments are creating the properties on a bare JS Object, and assigning 'undefined' will still create the property.

Also keep in mind that what you declare in your native types are only mapping about how to use/call the JS API, not necessarily what it actually is under the hood; i.e. just because you use a field does not mean that it's actually a "simple" JS property: it could have been defined with a setter, so guest2.lastName=undefined might actually have a side-effect other than creating a property (that's exactly that kind of property that's declared when you use getter/setter methods for a @JsProperty in a non-native type); and conversely, you could use getter/setter methods for a @JsProperty in a native type, that's a "simple" property in JS.

BTW, the 'undefined' here is seen by GWT as a Java 'null', but it won't bother initializing the field with 'null' as it treats 'undefined' and 'null' as equivalent (to a Java 'null'); this is an optimization technique (saves a few bytes in generated payload, and CPU cycles at runtime) that IIRC was added at some point in the GWT 2 lifecycle; earlier versions would explicitly initialize the uninitializedString field to null in the Test constructor/initializer.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Weird behavior from JsInterop for uninitialized fields/attributes.

Hello, 

This is a minor remark, and it does affect the functioning of JsInterop, as far as I experienced, but may be worth looking into by GWT folks. I have the following Js object that I am wrapping in Java:

var Hotel = function() {
 
this.guests = [];
};


Hotel.prototype = {
 addGuest
: function(guest) {
 
this.guests.push(guest);
 
},
 getGuestCount
: function(){
 
return this.guests.length;
 
}
}


@JsType(isNative=true, namespace=GLOBAL)
public class Hotel {
 
@JsMethod
 
public native final int getGuestCount();
 
 
@JsMethod
 
public native final void addGuest(Guest guest);
}

I pass a Guest object to the addGuest Method

@JsType(isNative=true, namespace=GLOBAL, name="Object")
public class Guest {
 
 
public int guestId;


 
public String firstName;


 
public String lastName;
 
 
public String roomNumber;
}


public class Test implements EntryPoint {


 
String uninitializedString;
 
 
public void onModuleLoad() {


   
Hotel hotel = new Hotel();


   
Guest guest = new Guest();
     guest
.firstName= "test";
   
//passed object is guest = {firstName: "test"}
     hotel
.addGuest(guest);


   
Guest guest2 = new Guest();
    guest2
.firstName = "test";
    guest2
.lastName = uninitializedString;
   
//passed object is guest = {firstName: "test", lastName: undefined}, should also be guest = {firstName: "test"}
    hotel
.addGuest(guest2);
}

}


In short, if you are assigning an uninitialized variable to an uninitialized Object field, the field will not be ignored anymore by JsInterop, and will be transpiled as undefined, although it is still uninitialized. This happens often with the builder pattern.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Monday, August 28, 2017

Re: GWT Application gets “404 The requested resource is not available”.

Hi Jen,

I have done what you mentioned as well. Here is the content of /opt/tomcat/conf/server.xml 

<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.tomee.catalina.ServerListener" />
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" xpoweredBy="false" server="Apache TomEE" />

   <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
   <Engine name="Catalina" defaultHost="localhost">
   <Realm className="org.apache.catalina.realm.LockOutRealm">
   <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
   </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

Here is the content of "/etc/libapache2-mod-jk/workers.properties".

workers.tomcat_home=/opt/tomcat  workers.java_home=/usr/lib/jvm/java-8-oracle/jre  ps=/  worker.list=ajp13_worker  worker.ajp13_worker.port=8009  worker.ajp13_worker.host=localhost  worker.ajp13_worker.type=ajp13  worker.ajp13_worker.lbfactor=1  worker.loadbalancer.type=lb  worker.loadbalancer.balance_workers=ajp13_worker

I found some article online mentioned that I need to create symbolic link for GWT application. I can't figure out if it is true or not, though. It said I need to add something like below to
SSL vhost configuration file.

DocumentRoot "/opt/tomcat/webapps/Index" Alias /Index "/opt/tomcat/webapps/Index" <Directory "/opt/tomcat/webapps/Index"> Options Indexes FollowSymLinks AllowOverride NONE Order allow,deny Allow from all </Directory> <Location "/Index/WEB-INF/"> AllowOverride None Deny from all </Location> JKMountCopy On JKMount /* ajp13_worker




On Monday, August 28, 2017 at 1:56:22 AM UTC-7, Jens wrote:

Thank you so much for your reply. However, I heard that mod_proxy is slower that Mod JK, so I made a switch just a little while ago :)

Oh sorry, somehow missed you are using mod_jk. Never really used it but then I guess you are missing some configuration needed on your production system.

Maybe the statement here does not take port 8080 into consideration ? -> "DocumentRoot "/opt/tomcat/webapps/Index"
Maybe I should try get rid of this same line within http vhost config file?

I think you should have a workers.properties file which is used to tell apache / mod_jk how to access the worker you have named "ajp13_worker". It should have host and port config values. But I guess if these values would be wrong you would get a HTTP 5xx status code and not a 4xx one.

Maybe change mod_jk logging to debug to get more information.

-- J.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: GWT Application gets “404 The requested resource is not available”.


Thank you so much for your reply. However, I heard that mod_proxy is slower that Mod JK, so I made a switch just a little while ago :)

Oh sorry, somehow missed you are using mod_jk. Never really used it but then I guess you are missing some configuration needed on your production system.

Maybe the statement here does not take port 8080 into consideration ? -> "DocumentRoot "/opt/tomcat/webapps/Index"
Maybe I should try get rid of this same line within http vhost config file?

I think you should have a workers.properties file which is used to tell apache / mod_jk how to access the worker you have named "ajp13_worker". It should have host and port config values. But I guess if these values would be wrong you would get a HTTP 5xx status code and not a 4xx one.

Maybe change mod_jk logging to debug to get more information.

-- J.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Saturday, August 26, 2017

Re: GWT Application gets “404 The requested resource is not available”.

Hi Jen,

Thank you so much for your reply. However, I heard that mod_proxy is slower that Mod JK, so I made a switch just a little while ago :)

Here is what the users expect.

1.If the users type (http://)www.zethanath.tk in the browser, mod_rewrite, near the end of http vhost conf,
would redirect the user to (https://www.zethanath.tk). I am using mod_rewrite here.

<
VirtualHost *:80 >

...

RewriteEngine on RewriteCond %{SERVER_NAME} =www.zethanath.tk RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

</VirtualHost>
 
2. At this point, SSL vhost should use Mod JK to redirect the users to my GWT application on TomEE Server. My GWT application, in this case, is stored at /opt/tomcat/webapps/ with the name Index.war. but I do not know why I keep getting "404 The resource is not available".

<IfModule mod_ssl.c>    <VirtualHost _default_:443>
...
  
DocumentRoot
"/opt/tomcat/webapps/Index"

  JKMountCopy On    JKMount /* ajp13_worker

  ...  

</VirtualHost> </IfModule>

I can see my GWT application working correct as http://192.168.1.70:8080/Index from Firefox, but I do not know why I got 404 error.
I allow 8080 on my firewall and router. I assigned 775 permission on Index.war, as well as the associated Index directory.

Maybe the statement here does not take port 8080 into consideration ? -> "DocumentRoot "/opt/tomcat/webapps/Index"
Maybe I should try get rid of this same line within http vhost config file?



On Saturday, August 26, 2017 at 12:08:31 PM UTC-7, Jens wrote:
Looks like you want to use Apache + Tomcat. In that case you need to configure Apache as reverse proxy to your Tomcat. There are basically two variants:

1.) Your complete GWT app (GWT JavaScript, index.html, all server code) is inside your *.war file. In that case you would proxy any request to your domain to tomcat which usually runs on localhost:8080. So your virtual host in Apache would contain something like ProxyPass / http://localhost:8080/Index 

2.) You let Apache serve all the static files (GWT JavaScript, index.html) and tomcat only has the server code of your app in your *.war file. In that case your Apache virtual host would have a document root pointing to the folder of your GWT app and only requests to tomcat (server requests your app  makes using GWT-RPC, RequestBuilder, REST, whatever you use) would need to be proxied by Apache. So you might end up having more proxy configuration. This is more an optimization solution because you can now tune apache to serve static files and tune tomcat to deliver dynamic content.

You should google for Apache mod_proxy to find some more documentation on reverse proxying using Apache.

-- J.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: GWT Application gets “404 The requested resource is not available”.

Looks like you want to use Apache + Tomcat. In that case you need to configure Apache as reverse proxy to your Tomcat. There are basically two variants:

1.) Your complete GWT app (GWT JavaScript, index.html, all server code) is inside your *.war file. In that case you would proxy any request to your domain to tomcat which usually runs on localhost:8080. So your virtual host in Apache would contain something like ProxyPass / http://localhost:8080/Index 

2.) You let Apache serve all the static files (GWT JavaScript, index.html) and tomcat only has the server code of your app in your *.war file. In that case your Apache virtual host would have a document root pointing to the folder of your GWT app and only requests to tomcat (server requests your app  makes using GWT-RPC, RequestBuilder, REST, whatever you use) would need to be proxied by Apache. So you might end up having more proxy configuration. This is more an optimization solution because you can now tune apache to serve static files and tune tomcat to deliver dynamic content.

You should google for Apache mod_proxy to find some more documentation on reverse proxying using Apache.

-- J.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

GWT Application gets “404 The requested resource is not available”.

Hi there.


I do not know why I keep getting "404 The requested resource is not available", when I am accessing my GWT Application. I am hosting my GWT application, on my TomEE/8.5.6 (7.0.2) at home, currently.

Here is the situation.

  1. I am able to use my GWT application from "TomEE Web Application Manager" as (http)://192.168.1.70:8080/Index

  2. However, when I type (http)://www.zethanath.tk in the browser, I would get (https)://www.zethanath.tk/ with HTTP Status 404.

Here is the details of my configuration.


Ubuntu:/opt/tomcat/webapps$ ls -l  total 20932  drwxrwxr-x 14 tomcat tomcat     4096 Aug  4 11:46 docs  drwxrwxr-x  5 tomcat tomcat     4096 Aug  4 11:46 host-manager  drwxrwxrwx  5 tomcat tomcat     4096 Aug 25 08:46 Index  -rwxrwxrwx  1 tomcat tomcat 21411520 Aug 25 08:46 Index.war  drwxrwxr-x  5 tomcat tomcat     4096 Aug  4 11:46 manager  drwxrwxr-x  3 tomcat tomcat     4096 Aug  8 17:30 ROOT

sudo nano 000-default.conf

<VirtualHost *:80 > Protocols h2 http/1.1 ServerAdmin erick9.hi5@gmail.com ServerName www.zethanath.tk ServerAlias servlet.zethanath.tk zethanath.tk DocumentRoot "/opt/tomcat/webapps/Index" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined RewriteEngine on RewriteCond %{SERVER_NAME} =www.zethanath.tk RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet

sudo nano default-ssl.conf

<IfModule mod_ssl.c> <VirtualHost _default_:443> Protocols h2 http/1.1 ServerAdmin erick9.hi5@gmail.com ServerName www.zethanath.tk ServerAlias servlet.zethanath.tk zethanath.tk DocumentRoot "/opt/tomcat/webapps/Index" JKMountCopy On JKMount /* ajp13_worker ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile /etc/letsencrypt/live/zethanath.tk/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/zethanath.tk/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> </VirtualHost> </IfModule> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I keep thinking that I need to associate port 8080 with "DocumentRoot "/opt/tomcat/webapps/Index", but I am unsure how.

Here is the details of my UFW. I have similar setup in the router.


sudo ufw status  Status: active    To                         Action      From  --                         ------      ----  OpenSSH                    ALLOW       Anywhere                    Apache Full                ALLOW       Anywhere                    20/tcp                     ALLOW       Anywhere                    21/tcp                     ALLOW       Anywhere                    990/tcp                    ALLOW       Anywhere                    40000:50000/tcp            ALLOW       Anywhere                    Apache Secure              ALLOW       Anywhere                    8080                       ALLOW       Anywhere                    OpenSSH (v6)               ALLOW       Anywhere (v6)               Apache Full (v6)           ALLOW       Anywhere (v6)               20/tcp (v6)                ALLOW       Anywhere (v6)               21/tcp (v6)                ALLOW       Anywhere (v6)               990/tcp (v6)               ALLOW       Anywhere (v6)               40000:50000/tcp (v6)       ALLOW       Anywhere (v6)               Apache Secure (v6)         ALLOW       Anywhere (v6)               8080 (v6)                  ALLOW       Anywhere (v6) 

Help is greatly appreciated.


--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: How to configure GWT project in eclipse to export war?

Hi there,

This post below was helping me to succeed.

https://stackoverflow.com/questions/10316003/how-to-make-war-file-of-gwt-project-in-eclipse

However, when I was facing the similar problem to your, this is how I done it. It is pretty much starting over, but I love it.

1. I downloaded the latest gwt here http://www.gwtproject.org/download.html. Please note that I use "GWT SDK" from the first one.
2. I downloaded the latest Eclipse. Please note that I have tried using older Eclipse 3.8.1-8, which is in Linux repositories, but it would not work with the plugin "GWT Eclipse Plugin". From the link here, http://www.gwtproject.org/download.html, please click on the second link "Plugin for Eclipse", drag, and Drop "Install" button" onto Eclipse.

3. Installed the file from step 1, and follow the steps here. If I don't create my project this way, I have problem, as the tutorial is much more difficult to follow. I also found that troubleshoot, and getting help online is a lot easier.

cd
gwt-2.8.1 chmod u+x webAppCreator ./webAppCreator -out MyWebApp com.mycompany.mywebapp.MyWebApp

At this point, your project would be here in this folder "gwt-2.8.1".

4. Now, this step is important for me, and it is what you are facing.

The tutorial would ask you to do this, which would work as well.

cd MyWebApp/    ant devmode

But this command below, would make thing perfect just for you :)

cd MyWebApp/ ant eclipse.generate

5. Now, you may import your new project to Eclipse. I think it is File > Import > Import Existing Project to Workspace.
6. From the link here https://stackoverflow.com/questions/10316003/how-to-make-war-file-of-gwt-project-in-eclipse.
It was this section that helps me.

The best approach is to use the command

Export > Export ... > Web > War file

You will have this command on the context menu (right mouse button on the project folder) if you installed the Java tools for Web Applications. Otherwise that should you first step.

It may be the case that your GWT project doesn't show on the selector of the Web Project field, the first on on the dialogue box when you execute the command above. If this is the case you must make sure you have the Dynamic Web Module facet on you project. Select the project root project navigator and then execute

Properties > Project Facets

and check Dynamic Web Module on the right panel if it not already checked.

You should make sure that the WAR directory used by GWT is the same used by the dynamic web module. If you are not sure what is your WAR directory (probably it's the one named "war") you can go to

Properties > Google > Web Application

 

.... 

 
Please enjoy.
 









On Sunday, August 13, 2017 at 7:54:16 AM UTC-7, Pool Petter Hijuela Florian wrote:
Hi.    Creating the project: GDT Pulldown >> New Web Application project (use GWT 2.7 and do not use AppEngine)    ...    Right click on the project >> Export >> Web >> WAR file >> Web Project ... This is where I have the problem. The name of my GWT project does not appear.
Currently I generate the WAR in this way: Right click on the project >> Google >> GWT Compile .... Copy the war folder in eclipse, compress it and change the extension to .war (Myproject.war). Any suggestions?
Thank You.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Friday, August 25, 2017

Re: How to use GWT war file as welcome page in Apache Tomcat (TomEE)/8.5.6 (7.0.2).

Thank you so much. Eventually, I ended up changing a lot of configuration, and I decided to drop this tutorial of mine.

On Tuesday, August 8, 2017 at 10:52:09 PM UTC-7, Craig Mitchell wrote:
This isn't really a GWT question, but what I would do is:
1. Undeploy the "Welcome to Tomcat" app that is currently in root.
2. Rename your war file to ROOT.war, and deploy it.

You should now have your GWT app at root.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: Programmatically clicking hyperlink

On Friday, August 17, 2007 at 2:26:51 PM UTC-5, BiggerBadderBen wrote:
> I just figured out an easier way to do what I want:
>
>
>
> History.add("OtherPage");
>
> History.forward();
>
> Works like a charm!
>
> Ben

Ben, I unsuccessfully tried a short Google Sheet script function with these two lines of code and no luck (ReferenceError: "History" is not defined.) Are there more lines of code in your code? Thanks.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Thursday, August 24, 2017

Corners Point Widget

Hello,
Do you know any material to detect the horns of any widget?

The point is that as you clicked in the widget it has been marked its
points on the corners

Regards

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: ClassCastException in generics

https://bugs.chromium.org/p/chromium/issues/detail?id=758240

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Wednesday, August 23, 2017

Re: ClassCastException in generics

Wow!

Isn't this somewhat serious? It looks that it bypass the browser's security model, XSS and all that...

That was one fascinating thread to watch.

On Wed, Aug 23, 2017 at 4:33 PM, Thomas Broyer <t.broyer@gmail.com> wrote:


On Wednesday, August 23, 2017 at 2:31:20 PM UTC+2, Kirill Prazdnikov wrote:
public static native FileReader newFileReader() /*-{
return new $wnd.FileReader();
}-*/;

This will not help, fileReader.resultArrayBuffer()returns not a instance of $wnd.ArrayBuffer anyway.

Ouch! You're unfortunately right: https://jsfiddle.net/wuvbnpz6/1/
…at least in Chrome; because Firefox works as intended!
Please report the bug at https://crbug.com (if no-one did already), and in the mean time, use name="Object", or possibly use a Java interface rather than a class.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.



--
Vassilis Virvilis

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: ClassCastException in generics



On Wednesday, August 23, 2017 at 3:02:08 PM UTC+2, Kirill Prazdnikov wrote:


Then my next question: 

if GWT generates checkckast as "yze_g$(fileBuffer_0_g$, $wnd.ArrayBuffer)",  where "$wnd.ArrayBuffer" is a type
how can I ask GWT to generate checkckast  to ArrayBuffer, not to $wnd.ArrayBuffer ?

In case you really need to reference a type in GWT's hidden iframe, then you can use namespace="<window>" instead of namespace=GLOBAL;

No, I want reference to a global type.

Terminology confusion here.
 
but this is undocumented behavior that could possibly change or break at any time.
Better fix you JSNI to use $wnd, or use JsInterop all the way down, with namespace=GLOBAL.

Why with namespace=GLOBAL  gwt generates checks that type is $wnd.ArrayBuffer ?

Because that's what GLOBAL means, which is what you want 99.9% of the time (except when you find a bug in Chrome that returns an object from the current browsing context rather than the one from the originating object)
 

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Re: ClassCastException in generics



On Wednesday, August 23, 2017 at 2:31:20 PM UTC+2, Kirill Prazdnikov wrote:
public static native FileReader newFileReader() /*-{
return new $wnd.FileReader();
}-*/;

This will not help, fileReader.resultArrayBuffer()returns not a instance of $wnd.ArrayBuffer anyway.

Ouch! You're unfortunately right: https://jsfiddle.net/wuvbnpz6/1/
…at least in Chrome; because Firefox works as intended!
Please report the bug at https://crbug.com (if no-one did already), and in the mean time, use name="Object", or possibly use a Java interface rather than a class.

--
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 post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.