forked from gwtproject/gwt-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
related to gwtproject/gwt#10042
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/main/markdown/doc/latest/gwt-dev-help/WebAppClassPath.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Web App Classpath Problem | ||
|
||
You were directed to this help topic because your server code needed a class or resource that was not found on the *web app classpath*, but **was** found on the *system classpath*. The *system classpath* is the classpath you specify when launching the Java VM to run hosted mode. The *web app classpath* is different — it consists of classes that live in your web application's *war directory*. All server classes and dependencies should be placed in your war directory: libraries (jars) should be placed in `war/WEB-INF/lib/` and classes that don't live in jars should be placed in `war/WEB-INF/classes/`. | ||
|
||
GWT hosted mode helpfully works around this problem by mapping these outside resources into your web app classpath. This warning reminds you that failing to address the issue can lead to problems when you actually deploy your web app to a real server. | ||
|
||
## Tips | ||
|
||
- The most common reason to encounter this problem with a new project is using RPC, which tries to load `com.google.gwt.user.client.rpc.RemoteService`. The solution is to copy `gwt-servlet.jar` from the GWT install directory into your web app's `war/WEB-INF/lib/` directory. | ||
|
||
- If you have a good reason for not following the recommended configuration, you can suppress the warning by setting the Java system property `gwt.nowarn.webapp.classpath`. Specify `-Dgwt.nowarn.webapp.classpath` as a JVM argument when launching hosted mode. |
11 changes: 11 additions & 0 deletions
11
src/main/markdown/doc/latest/gwt-dev-help/longJsniRestriction.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Restrictions on Long Values with JSNI | ||
|
||
The Java `long` type cannot be represented in JavaScript as a numeric type, so GWT emulates it using an opaque data structure. This means that JSNI methods cannot process a `long` as a numeric type. The compiler, therefore, disallows, by default, directly accessing a `long` from JSNI: JSNI methods cannot have `long` as a parameter type or a return type, and they cannot access a `long` using a JSNI reference. If you find yourself wanting to pass a `long` into or out of a JSNI method, here are some options: | ||
|
||
1. **For numbers that fit into type `double`**, use type `double` instead of type `long`. | ||
|
||
2. **For computations that require the full `long` semantics**, rearrange the code so that the computations happen in Java instead of in JavaScript. That way, they will use the `long` emulation. | ||
|
||
3. **For values meant to be passed through unchanged to Java code**, wrap the value in a `Long`. There are no restrictions on type `Long` with JSNI methods. | ||
|
||
4. **If you are sure you know what you are doing**, you can add the annotation `com.google.gwt.core.client.UnsafeNativeLong` to the method. The compiler will then allow you to pass a `long` into and out of JavaScript. It will still be an opaque data type, however, so the only thing you will be able to do with it will be to pass it back to Java. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Servlet Mappings, GWT Modules, and web.xml | ||
|
||
GWT modules may declare one or more `<servlet>` tags. These define Java Servlets that implement the server-side component of a GWT-enabled web application. | ||
|
||
In modern GWT applications, these are only used for testing, and it is discouraged to use them in application code. | ||
|
||
During hosted mode startup, the set of *expected* servlets (from GWT module `<servlet>` tags) is validated against the set of actual servlets (from the `WEB-INF/web.xml`) and a warning is issued for each *expected* servlet which does not match an actual servlet. |